Skip to content

Commit 3265c8d

Browse files
committed
MC-6271: Add docs for content type forms
WIP: form updates
1 parent 471781b commit 3265c8d

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

docs/create-basic-content-type/step-4-add-form.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,39 @@ Page Builder provides an editor that slides out from the right of the screen wit
99

1010
![Create config file](../images/content-type-editor.png)
1111

12-
## Configuration
12+
13+
14+
## Form conventions
15+
16+
Add the layout and form to your module as shown here:
17+
18+
- `view/adminhtml/web/layout/`
19+
- `view/adminhtml/web/ui-component/`
20+
21+
![Create config file](../images/step4-add-form.png)
22+
23+
24+
25+
## Form configuration
1326

1427
In your configuration file, reference your UI component form as shown here within the `<type>` element:
1528

1629
```xml
1730
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1831
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
19-
<type name="example"
20-
label="Example"
21-
form="pagebuilder_example_form"
32+
<type name="example_quote"
33+
label="Quote"
34+
form="pagebuilder_example_quote_form"
2235
...
2336
```
2437

2538
| Attribute | Description |
2639
| --------- | ------------------------------------------------------------ |
2740
| `form` | `pagebuilder_example_form.xml` - UI component form that provides the editor for your content type. |
2841

29-
## Location
42+
## Quote form
3043

31-
Add the layout and form to your module as shown here:
32-
33-
- `view/adminhtml/web/layout/`
34-
- `view/adminhtml/web/ui-component/`
35-
36-
![Create config file](../images/step4-add-form.png)
37-
38-
## Create UI component form
39-
40-
In this example, let's create a form that extends `pagebuilder_base_form` to provide form controls for editing our content type. The code is provided here followed by descriptions of the key parts.
44+
Our Quote form extends `pagebuilder_base_form` to provide form controls for editing our content type. The form XML is shown in full here, followed by descriptions of the key parts.
4145

4246
```xml
4347
<?xml version="1.0" encoding="UTF-8"?>
@@ -179,8 +183,25 @@ In this example, let's create a form that extends `pagebuilder_base_form` to pro
179183
</form>
180184
```
181185

182-
[Insert descriptions]
183186

184-
## Create layout
185187

186-
The remainder of this topic is in progress.
188+
Discuss the extending of forms `extends="pagebuilder_base_form"` and the other form with more stuff.
189+
190+
## Quote form layout
191+
192+
The layout for our Quote form is shown here in full:
193+
194+
```xml
195+
<?xml version="1.0"?>
196+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
197+
<update handle="styles"/>
198+
<body>
199+
<referenceContainer name="content">
200+
<uiComponent name="pagebuilder_example_quote_form"/>
201+
</referenceContainer>
202+
</body>
203+
</page>
204+
```
205+
206+
This is a standard UI component form layout. For more information, see [ui component reference].
207+

0 commit comments

Comments
 (0)