@@ -102,14 +102,53 @@ The Quote form is shown in full here for you to copy into your `pagebuilder_exam
102
102
</settings >
103
103
</dataProvider >
104
104
</dataSource >
105
+ <fieldset name =" appearance_fieldset" sortOrder =" 10" component =" Magento_PageBuilder/js/form/element/dependent-fieldset" >
106
+ <settings >
107
+ <label translate =" true" >Appearance</label >
108
+ <additionalClasses >
109
+ <class name =" admin__fieldset-visual-select-large" >true</class >
110
+ </additionalClasses >
111
+ <collapsible >false</collapsible >
112
+ <opened >true</opened >
113
+ <imports >
114
+ <link name =" hideFieldset" >${$.name}.appearance:options</link >
115
+ <link name =" hideLabel" >${$.name}.appearance:options</link >
116
+ </imports >
117
+ </settings >
118
+ <field name =" appearance" formElement =" select" sortOrder =" 10" component =" Magento_PageBuilder/js/form/element/dependent-visual-select" >
119
+ <argument name =" data" xsi : type =" array" >
120
+ <item name =" config" xsi : type =" array" >
121
+ <item name =" default" xsi : type =" string" >default</item >
122
+ </item >
123
+ </argument >
124
+ <settings >
125
+ <additionalClasses >
126
+ <class name =" admin__field-wide" >true</class >
127
+ <class name =" admin__field-visual-select-container" >true</class >
128
+ </additionalClasses >
129
+ <dataType >text</dataType >
130
+ <validation >
131
+ <rule name =" required-entry" xsi : type =" boolean" >true</rule >
132
+ </validation >
133
+ <elementTmpl >Magento_PageBuilder/form/element/visual-select</elementTmpl >
134
+ </settings >
135
+ <formElements >
136
+ <select >
137
+ <settings >
138
+ <options class =" AppearanceSourceQuote" />
139
+ </settings >
140
+ </select >
141
+ </formElements >
142
+ </field >
143
+ </fieldset >
105
144
<fieldset name =" general" sortOrder =" 20" >
106
145
<settings >
107
146
<label />
108
147
</settings >
109
148
<field name =" quote_text" sortOrder =" 10" formElement =" textarea" >
110
149
<argument name =" data" xsi : type =" array" >
111
150
<item name =" config" xsi : type =" array" >
112
- <item name =" source" xsi : type =" string" >page</item >
151
+ <item name =" source" xsi : type =" string" >page</item >
113
152
</item >
114
153
</argument >
115
154
<settings >
@@ -121,7 +160,7 @@ The Quote form is shown in full here for you to copy into your `pagebuilder_exam
121
160
<field name =" quote_author" sortOrder =" 20" formElement =" input" >
122
161
<argument name =" data" xsi : type =" array" >
123
162
<item name =" config" xsi : type =" array" >
124
- <item name =" source" xsi : type =" string" >page</item >
163
+ <item name =" source" xsi : type =" string" >page</item >
125
164
</item >
126
165
</argument >
127
166
<settings >
@@ -144,20 +183,49 @@ The Quote form is shown in full here for you to copy into your `pagebuilder_exam
144
183
</field >
145
184
<field name =" quote_css" sortOrder =" 40" formElement =" input" >
146
185
<argument name =" data" xsi : type =" array" >
147
- <item name =" config" xsi : type =" array" >
148
- <item name =" source" xsi : type =" string" >page</item >
149
- </item >
186
+ <item name =" config" xsi : type =" array" >
187
+ <item name =" source" xsi : type =" string" >page</item >
188
+ </item >
150
189
</argument >
151
190
<settings >
152
- <dataScope >quote_css</dataScope >
153
- <dataType >text</dataType >
154
- <label translate =" true" >CSS for Quote</label >
191
+ <dataScope >quote_css</dataScope >
192
+ <dataType >text</dataType >
193
+ <label translate =" true" >CSS for Quote</label >
155
194
</settings >
156
195
</field >
157
196
</fieldset >
158
197
</form >
159
198
```
160
199
200
+ ### appearance fieldset and field
201
+
202
+ Page Builder requires you to add the ` appearance_fieldset ` along with its ` appearance ` field for all your content type forms. Even though our Quote content type doesn’t have any additional appearances, the field is still required/expected so that other modules can add appearances to your content type as needed.
203
+
204
+ To ensure your appearance field renders, create a ` di.xml ` file located here:
205
+
206
+ ![ Create config file] ( ../images/step4-field-appearance-class.png )
207
+
208
+ Then add the source implementation as referenced in the ` appearance ` field (` <options class="AppearanceSourceQuote"/> ` ) as shown here:
209
+
210
+ ``` xml
211
+ <?xml version =" 1.0" ?>
212
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
213
+ <virtualType name =" AppearanceSourceQuote" type =" Magento\PageBuilder\Model\Source\VisualSelect" >
214
+ <arguments >
215
+ <argument name =" optionsSize" xsi : type =" string" >large</argument >
216
+ <argument name =" optionsData" xsi : type =" array" >
217
+ <item name =" 0" xsi : type =" array" >
218
+ <item name =" value" xsi : type =" string" >default</item >
219
+ <item name =" title" xsi : type =" string" translate =" true" >Default</item >
220
+ </item >
221
+ </argument >
222
+ </arguments >
223
+ </virtualType >
224
+ </config >
225
+ ```
226
+
227
+ Again, even though our Quote control doesn't currently define an appearance, we must implement all the parts so that other modules can expect each Page Builder content type to have an appearance defined, even if it is not used.
228
+
161
229
### fieldset
162
230
163
231
Page Builder requires fields to be grouped within named ` <fieldset> ` elements. Fieldsets provide your fields with a basic grouping mechanism and an optional label. You can define as many fieldsets as you want.
0 commit comments