...
and use configurations of their types form the table
Adding custom field to Component Configurator
Example Task: My designs say that the image teaser component can have either white (default), grey or black background. A client wants to decide on that while configuring component.
...
...
Please pay attention to the frontend_type entry in the custom field configuration.
This entry is used to tell the frontend part of a component, if this is html or a css_class. Default value is html. If you specify this as css_class, then the chosen value will be automatically added to the class list of the component’s container. No need to do anything else. Script automatically finds all custom fields with this type, collects them and adds to the additional classes property.
You can use this in custom fields for whole component as well as image teaser slide.
Adding custom field to Component Configurator
Example Task: My designs say that the image teaser component can have either white (default), grey or black background. A client wants to decide on that while configuring component.
...
Code Block |
---|
// theme-example/src/etc/view.xml <vars module="MageSuite_ContentConstructor"> <var name="image_teaser"> <var name="label">Advanced</var>custom_sections"> <var name="0"> <var name="label">Advanced</var> <var name="content"> <var name="fields"> <var name="0"> <var name="label">Component's container background color</var> <var name="type">select</var> <var name="model">background</var> <var name="options"> <var name="cs-container--bg-white">White</var> <var name="cs-container--bg-grey">Grey</var> <var name="cs-container--bg-black">Black</var> </var> <var name="default">cs-container--bg-white</var> <var name="frontend_type">css_class</var> </var> </var> </var> </var> </var> </var> </vars> |
...
Code Block |
---|
<vars module="MageSuite_ContentConstructor"> <var name="teaser"> <var name="tabs"> <var name="23"> <var name="label">badge</var> <var name="content"> <var name="fields"> <var name="0"> <var name="label">Badge text</var> <var name="type">textarea</var> <var name="model">badge_text</var> <var name="hint"><![CDATA[ Add content with special markup, e.g.:<br> - <small>Only</small> {{price sku="some_sku"}}<br> - {{sku sku="some_sku"}}<br> - <big>Only</big> {{qty sku="some_sku"}} left ]]></var> </var> <var name="1"> <var name="label">Badge align</var> <var name="type">position</var> <var name="model">badge_align</var> <var name="rows">3</var> <var name="columns">3</var> <var name="default"> <var name="x">1</var> <var name="y">1</var> </var> <var name="warning">Note: Please verify text position configuration in the "Content" tab. It might overlap the badge position.</var> </var> </var> </var> </var> </var> </var> </vars> |
...
Field type | Description | Vars available | Markup example | Effect | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input | Text type input. Dedicated for providing custom CSS classes or short content |
Code Block |
|
| |||||||||
select | Select field. Dedicated for limited options, like pre-defined CSS classes or icons | Same as for "input". The only difference is that value of default has to cover one of defined options |
| ||||||||||
multiselect | Mulstiselect field, that allows selecting multiple options. | Extends select vars. The difference is that default options contain array of default entries, with the value that stands for option “name”. |
| select | Select field. Dedicated for limited options, like pre-defined CSS classes or icons | Same as for "input". The only difference is that value of default has to cover one of defined options |
| ||||||
textarea | Textarea for more complex content. Remember to not provide too much of it as frontend might have problems to fit all of it. You can use directives. | Same as for "input" |
| ||||||||||
position | Position grid feature known from Content Align feature to set position of text for single teaser |
|
| ||||||||||
checkbox | checkbox styled magento way (switcher-alike). Use it if you need boolean value on the frontend |
|
| ||||||||||
radio | Standard options list | Same as for "select" |
| ||||||||||
color | Color value with picker |
|
| ||||||||||
datetime-range | Date time range picker, that consists of two inputs with type “datetime-local” |
|
|
...