You can create different types of components that can be reused in feature outcomes. After setting up the components in a central library, you and your team can easily add the templates to specific feature rules instead of manually creating similar components multiple times for different rules.
The following component types are available:
- Component Template: UI components based on HTML templates. See Component Template for more information.
- Custom Component Block: See the Custom Component Block for more information.
- Form: The Form option includes Login, Registration and Forgot Password Forms, Data Capture Forms, and Complete Registration Forms.
- Payment Form: See Payment Forms for more information.
- Subscription Cancel Form: See Subscription Change Forms for more information.
Create and manage components in Component Library
On the Component Library page, you can view the existing components. For example, a payment form component will be displayed as follows:
Components are listed by the last updated time. You can search for specific components using the search bar at the top of the page. For the form type components, each form type is represented by a fixed thumbnail, which means you cannot customise the thumbnail for a specific form component.
To create a component:
- Navigate to Delivery > Component Library
- Click + Add Component
- In the pop-up window, click select the type of the component to be created, and then click Add
- Complete the required configurations for the selected component, following the below tutorials:
- Component templates
- Custom component blocks
- Forms: Login, Registration and Forgot Password Forms, Data Capture Forms, and Complete Registration Forms
- Payment forms
- Subscription change forms
Note: You can create a template component when adding a form or custom component block to an outcome. To do so, select Save & Add to Component Library when saving it.
You can create and manage the versions of a component:
- Click the component that you want to edit, or click More Action > Edit
- On the Component Details page, you can edit or delete a version, create new versions, or set a version as the default.
You can also clone or delete a component by clicking the More Action icon of the component and then clicking Delete or Clone.
Retrieve components as rendered HTML
Components configured in the Component Library can be retrieved as rendered HTML using the Public API. You can specify the version of a component that will be retrieved in the path.
Below is an example request:
To retrieve version 1 of the form, you can specify the path parameter to payment-form:1. To reference the default version, use payment-form:active or just exclude any version number in the parameter, for example payment-form.
For more information about how to retrieve components, see the Component Library API reference.
Add components to the feature rules
When adding an outcome to a feature rule, you can use the components created in the Component Library.
Take the following steps to add a component from Component Library:
- On the Add an Outcome page, click + Add A New Form Or Custom Component Block under the Components section.
- On the Select a Component window, select the component you want to add.
- Determine the version to be used. The default version will be automatically selected. To change to another version, turn off the Use Default Version toggle button, and then select the version to be used from the version list.
- Click Save.
For more information about how to work with feature outcomes, see Feature Outcomes.