Custom attribute editors for Page Designer components
Key Takeaway
To connect a custom attribute editor to a component attribute, set the attribute's type to custom in the component meta definition file. Then reference the editor's ID in the attribute's editor_definition element.
A custom attribute editor is a control you build yourself for a Page Designer component attribute when none of the preconfigured controls fit. Merchants use it to set the attribute's value in the Business Manager visual editor. The editor runs in the merchant's browser and exchanges values with Page Designer through events.
When to build a custom attribute editor
The type value of an attribute in a component's meta definition file sets the UI control that merchants use to set the attribute's value. For example:
filegives a file picker.booleangives a check box.enumgives a select box.
When none of the preconfigured controls fit, build a custom attribute editor. Examples include:
- Selecting store locations on a map
- Choosing a text or background color
- Placing a Favorite icon on a product tile
- Choosing which Shop Now button to use