You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -5,7 +5,7 @@ The development of this tutorial is currently **IN PROGRESS**.
5
5
6
6
***
7
7
8
-
In this step, we will create a UI component form to give our Quote example an editor we can use to edit content and style its appearance in various ways.
8
+
In this step, we will create a UI component form so that we can give end-users an editor for entering content for the Quote and for styling its appearance when it is displayed in the Admin and on the storefront.
9
9
10
10
## About forms
11
11
@@ -19,15 +19,13 @@ Inheriting from either base form gives you an editor for your content type that
19
19
20
20
### `pagebuilder_base_form`
21
21
22
-
The `pagebuilder_base_form` gives you the following form fields in the editor, along with the Close, Reset, and Save buttons as shown here:
22
+
The `pagebuilder_base_form` gives you the following form fields in a fieldset named Advance, along with the Close, Reset, and Save buttons as shown here:
In addition the the "Advanced" form fields from `pagebuilder_base_form`, the `pagebuilder_base_form_with_background_attributes` gives you the following "Background" form fields as shown here:
28
+
In addition to all the fields from `pagebuilder_base_form`, the `pagebuilder_base_form_with_background_attributes` gives you the following "Background" form fields as shown here:
@@ -49,6 +47,165 @@ The form and layout files should be added to your module in the following locati
49
47
50
48
Make sure you add these files as shown before continuing.
51
49
50
+
## Quote form
51
+
52
+
The Quote form inherits from `pagebuilder_base_form_with_background_attributes` to provide all the form fields available for customizing our content type. In addition to the fields we get from inheritance, we want to add specific entry and styling fields for our Quote, as shown here:
The `<fieldset>` element is required and provides a basic grouping mechanism (with an optional label) for the fields in your form. You can define as many fieldsets as you want.
|`name`| You can name your fieldset whatever you want. Currently, it has no significance for data binding. |
149
+
|`sortOrder`| Determines where the fieldset is placed in the editor. The `sortOrder` for the `pagebuilder_base_form` fieldset is set to `90`. Setting your fieldset to a value less than that (such as `20`) will put your fieldset above the inherited fieldsets. A value greater than `90` will put your fieldset below the inherited fieldsets. |
150
+
151
+
### field
152
+
153
+
The `<field>` element creates the actual HTML form element as specified by the `formElement` attribute, such as input, select, textarea, and colorPicker.
|`name`| The name of the field used for data bindings. |
158
+
|`sortOrder`| Determines where the field is placed within the fieldset in relation to other fields. |
159
+
|`formElement`| Determines the HTML form element to render for the field. |
160
+
161
+
### argument data source
162
+
163
+
Defines the data source for the field.
164
+
165
+
[Need more info. What does it mean for the `page` to be specified as the data source?]
166
+
167
+
```xml
168
+
<argumentname="data"xsi:type="array">
169
+
<itemname="config"xsi:type="array">
170
+
<itemname="source"xsi:type="string">page</item>
171
+
</item>
172
+
</argument>
173
+
```
174
+
175
+
### settings
176
+
177
+
The `<settings>` element defines the data scope, data type, and label to use for the field, as shown here:
178
+
179
+
```xml
180
+
<settings>
181
+
<dataScope>quote_text</dataScope>
182
+
<dataType>text</dataType>
183
+
<labeltranslate="true">Quote</label>
184
+
</settings>
185
+
```
186
+
187
+
The `dataType` values are typically `text` and `boolean`.
188
+
189
+
[What is the dataScope? What's its significance? How is it used?]
190
+
191
+
## Quote form layout
192
+
193
+
The layout for our Quote form is shown in full here for you to copy into your `pagebuilder_example_form.xml` layout file. For more information about layouts, see [Layout instructions](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-instructions.html).
|`name`| Specifies the name of the element scope for the data binding when applied to template elements. In our example, the element name of `main` is used as the scope for binding styles and other attributes to the top-level `<div>` element in our template: `<div attr="data.main.attributes" ko-style="data.main.style">`|
The Quote form inherits from `pagebuilder_base_form_with_background_attributes` to provide all the form fields available for customizing our content type. In addition to the fields we get from inheritance, we want to add specific entry and styling fields for our Quote, as shown here:
The `<fieldset>` element is required and provides a basic grouping mechanism (with an optional label) for the fields in your form. You can define as many fieldsets as you want.
|`name`|_What significance or conventions apply to the fieldset name?_|
324
-
|`sortOrder`| Determines where the fieldset is placed in the editor. The `sortOrder` for the `pagebuilder_base_form` fieldset is set to `90`. Setting your fieldset to a value less than that (such as `20`) will put your fieldset above the inherited fieldsets. A value greater than `90` will put your fieldset below the inherited fieldsets. |
325
-
326
-
### field
327
-
328
-
The `<field>` element creates the actual HTML form element as specified by the `formElement` attribute, such as input, select, textarea, and colorPicker.
|`name`| The name of the field used for bindings. |
333
-
|`sortOrder`| Determines where the field is placed within the fieldset in relation to other fields. |
334
-
|`formElement`| Determines the HTML form element to render for the field. |
335
-
336
-
### argument data source
337
-
338
-
Defines the data source for the field.
339
-
340
-
[Need more info. What does it mean for the `page` to be specified as the data source?]
341
-
342
-
```xml
343
-
<argumentname="data"xsi:type="array">
344
-
<itemname="config"xsi:type="array">
345
-
<itemname="source"xsi:type="string">page</item>
346
-
</item>
347
-
</argument>
348
-
```
349
-
350
-
### settings
351
-
352
-
The `<settings>` element defines the data scope, data type, and label to use for the field, as shown here:
353
-
354
-
```xml
355
-
<settings>
356
-
<dataScope>quote_text</dataScope>
357
-
<dataType>text</dataType>
358
-
<labeltranslate="true">Quote</label>
359
-
</settings>
360
-
```
361
-
The `dataType` values are typically `text` and `boolean`.
362
-
363
-
[What is the dataScope? What's its significance? How is it used?]
364
-
365
-
## Quote form layout
366
-
367
-
The layout for our Quote form is shown in full here for you to copy into your `pagebuilder_example_form.xml` layout file. For more information about layouts, see [Layout instructions](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-instructions.html).
0 commit comments