Skip to content

Commit 156dc33

Browse files
MC-3032: Update Documentation
- change allowed_parents to parents and children
1 parent 6f55160 commit 156dc33

File tree

2 files changed

+46
-34
lines changed

2 files changed

+46
-34
lines changed

app/code/Magento/PageBuilder/docs/content-type-configuration.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ The following is an example of a content type configuration in `view/adminhtml/p
8181
icon="icon-pagebuilder-image"
8282
sortOrder="1"
8383
translate="label">
84-
<allowed_parents>
85-
<parent name="row"/>
86-
<parent name="column"/>
87-
</allowed_parents>
84+
<children default_policy="deny"/>
8885
<appearances>
8986
<appearance default="true"
9087
name="poster"
@@ -204,7 +201,8 @@ The following is an example of a content type configuration in `view/adminhtml/p
204201
| Element | Description |
205202
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
206203
| `type` | Describes the content type name, translated field, and sort order in the menu group. Each type should have its own configuration file. |
207-
| `allowed_parents` | List of parent content types that can accept this type as a child. |
204+
| `parents` | List of parent content types that can accept this type as a child. |
205+
| `children` | List of children content types that can accept this type as a parent. |
208206
| `appearances` | Appearance configuration. |
209207
| `is_visible` | Determines menu visibility for the component. System components should not be visible in the menu. Default value is true. |
210208
| `additional_data` | Allows to specify additional data for component, see [custom configuration for content type](custom-configuration.md) for more information. |
@@ -231,17 +229,44 @@ The `form` element specifies the name of the UiComponent form used to configure
231229

232230
Any modifications you might want to make to content type configuration forms use standard UiComponent functionality. Please see [UiComponent Documentation](http://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html) for additional information.
233231

234-
### `allowed_parents` configuration reference
232+
### `parents` configuration reference
235233

236-
The `allowed_parents` element specifies which content types can accept this type as a child.
234+
The `parents` element specifies which content types can accept this type as a child.
237235

238236
**Example:**
239237
``` xml
240-
<allowed_parents>
241-
<parent name="row"/>
242-
<parent name="column"/>
243-
</allowed_parents>
238+
<parents default_policy="deny">
239+
<parent name="row" policy="allow"/>
240+
<parent name="column" policy="allow"/>
241+
</parents>
244242
```
243+
| Element | Description |
244+
| ------------------- | -------------------------------------------------------------------------------------- |
245+
| `parent` | The name of the parent content type that is allowed or denied. |
246+
247+
| Attribute | Description |
248+
| ------------------- | -------------------------------------------------------------------------------------- |
249+
| `default_policy` | Allows or denies all content types to be parents unless specified as a parent element. |
250+
251+
### `children` configuration reference
252+
253+
The `children` element specifies which content types can accept this type as a parent.
254+
255+
**Example:**
256+
``` xml
257+
<children default_policy="allow">
258+
<child name="row" policy="deny"/>
259+
<child name="column" policy="deny"/>
260+
</children>
261+
```
262+
| Element | Description |
263+
| ------------------- | -------------------------------------------------------------------------------------- |
264+
| `child` | The name of the child content type that is allowed or denied |
265+
266+
| Attribute | Description |
267+
| ------------------- | -------------------------------------------------------------------------------------- |
268+
| `default_policy` | Allows or denies all content types to be children unless specified as a child element. |
269+
245270
### `appearances` configuration reference
246271

247272
The `appearances` element specifies how the content type renders in the admin preview and the master format.

app/code/Magento/PageBuilder/docs/how-to-add-new-content-type.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ To add configuration for a new content type, create a file under the following l
6060
icon="icon-modulename-simple"
6161
sortOrder="35"
6262
translate="label">
63-
<allowed_parents>
64-
<parent name="row"/>
65-
</allowed_parents>
63+
<parents default_policy="deny">
64+
<parent name="row" policy="allow"/>
65+
</parents>
6666
<appearances>
6767
<appearance default="true"
6868
name="default"
@@ -264,10 +264,13 @@ Now, let's add content type that can contain other content types. Create configu
264264
icon="icon-vendorname-complex"
265265
sortOrder="35"
266266
translate="label">
267-
<allowed_parents>
268-
<parent name="row"/>
269-
<parent name="column"/>
270-
</allowed_parents>
267+
<parents default_policy="deny">
268+
<parent name="row" policy="allow"/>
269+
<parent name="column" policy="allow"/>
270+
</parents>
271+
<children default_policy="deny">
272+
<child name="heading" policy="allow"/>
273+
</children>
271274
<appearances>
272275
<appearance default="true"
273276
name="default"
@@ -300,22 +303,6 @@ Now, let's add content type that can contain other content types. Create configu
300303
</config>
301304
```
302305

303-
Now we need to specify which content types can be inserted into our new content type. To allow default content type Heading be inserted into our Complex content type, add the following configuration.
304-
305-
`Vendor\ModuleName\view\adminhtml\pagebuilder\content_type\heading.xml`
306-
307-
``` XML
308-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
309-
<content_types>
310-
<type name="heading">
311-
<allowed_parents>
312-
<parent name="complex"/>
313-
</allowed_parents>
314-
</type>
315-
</content_types>
316-
</config>
317-
```
318-
319306
Now need to create preview and render templates.
320307

321308
`Vendor/ModuleName/view/adminhtml/web/template/content-type/complex/default/preview.html`

0 commit comments

Comments
 (0)