Skip to content

Commit 9538e28

Browse files
MC-2219: Execute Script and Resolve Issues
- update documentation
1 parent bab7423 commit 9538e28

File tree

4 files changed

+35
-60
lines changed

4 files changed

+35
-60
lines changed

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

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,31 @@ The following is an example of a group configuration in `view/adminhtml/pagebuil
5454
``` xml
5555
<!-- Definition of main menu, used for grouping content types -->
5656
<groups>
57-
<group name="media" translate="label" sortOrder="10">
58-
<label>Media</label>
59-
</group>
57+
<group name="media" translate="label" sortOrder="10" label="Media"/>
6058
</groups>
6159
```
6260
### Configuration reference
6361

6462
| Element | Description |
6563
| ------------------- | ------------------------------------------------------------------------ |
6664
| `group` | Describes the group name, translated field, and sort order in the menu. |
67-
| `label` | Label displayed on the menu. |
6865

66+
| Attribute | Description |
67+
| ------------------- | ------------------------------------------------------------------------ |
68+
| `label` | Label displayed on the menu. |
6969

7070
The following is an example of a content type configuration in `view/adminhtml/pagebuilder/content_type/banner.xml`:
7171

7272
``` xml
7373
<content_types>
7474
<!-- Content type declaration -->
75-
<type name="banner" translate="label" sortOrder="1">
76-
<label>Banner</label>
77-
<icon>icon-pagebuilder-image</icon>
78-
<component>Magento_PageBuilder/js/content-type</component>
79-
<preview_component>Magento_PageBuilder/js/content-type/banner/preview</preview_component>
80-
<content_component>Magento_PageBuilder/js/content-type/content</content_component>
81-
<form>pagebuilder_banner_form</form>
82-
<group>media</group>
75+
<type name="banner" sortOrder="1" translate="label" label="Banner" icon="icon-pagebuilder-image" component="Magento_PageBuilder/js/content-type" preview_component="Magento_PageBuilder/js/content-type/banner/preview" form="pagebuilder_banner_form" group="media">
8376
<allowed_parents>
8477
<parent name="row"/>
8578
<parent name="column"/>
8679
</allowed_parents>
8780
<appearances>
88-
<appearance name="poster" default="true">
81+
<appearance default="true" name="poster" preview_template="Magento_PageBuilder/content-type/banner/poster/preview" render_template="Magento_PageBuilder/content-type/banner/poster/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
8982
<data_mapping>
9083
<elements>
9184
<element name="main" path=".">
@@ -171,17 +164,14 @@ The following is an example of a content type configuration in `view/adminhtml/p
171164
</converter>
172165
</converters>
173166
</data_mapping>
174-
<preview_template>Magento_PageBuilder/content-type/banner/poster/preview</preview_template>
175-
<render_template>Magento_PageBuilder/content-type/banner/poster/master</render_template>
176-
<reader>Magento_PageBuilder/js/component/format/read/configurable</reader>
177167
</appearance>
178-
<appearance name="collage-left">
168+
<appearance name="collage-left" preview_template="Magento_PageBuilder/content-type/banner/collage-left/preview" render_template="Magento_PageBuilder/content-type/banner/collage-left/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
179169
<!-- Collage left appearance configuration -->
180170
</appearance>
181-
<appearance name="collage-centered">
171+
<appearance name="collage-centered" preview_template="Magento_PageBuilder/content-type/banner/collage-centered/preview" render_template="Magento_PageBuilder/content-type/banner/collage-centered/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
182172
<!-- Collage centered appearance configuration -->
183173
</appearance>
184-
<appearance name="collage-right">
174+
<appearance name="collage-right" preview_template="Magento_PageBuilder/content-type/banner/collage-right/preview" render_template="Magento_PageBuilder/content-type/banner/collage-right/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
185175
<!-- Collage right appearance configuration -->
186176
</appearance>
187177
</appearances>
@@ -193,17 +183,20 @@ The following is an example of a content type configuration in `view/adminhtml/p
193183
| Element | Description |
194184
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
195185
| `type` | Describes the content type name, translated field, and sort order in the menu group. Each type should have its own configuration file. |
186+
| `allowed_parents` | List of parent content types that can accept this type as a child. |
187+
| `appearances` | Appearance configuration. |
188+
| `is_visible` | Determines menu visibility for the component. System components should not be visible in the menu. Default value is true. |
189+
| `additional_data` | Allows to specify additional data for component, see [custom configuration for content type](custom-configuration.md) for more information. |
190+
191+
| Attribute | Description |
192+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
196193
| `label` | Label displayed on the menu and stage. |
197194
| `icon` | Icon displayed on the menu. |
198195
| `component` | View model responsible for rendering the preview and master format. |
199196
| `preview_component` | Helper component that contains preview specific logic. Helper component is optional. |
200-
| `content_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
197+
| `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
201198
| `form` | UI component form used for editing the content type |
202199
| `group` | Existing menu group that contains this content type. |
203-
| `allowed_parents` | List of parent content types that can accept this type as a child. |
204-
| `appearances` | Appearance configuration. |
205-
| `is_visible` | Determines menu visibility for the component. System components should not be visible in the menu. Default value is true. |
206-
| `additional_data` | Allows to specify additional data for component, see [custom configuration for content type](custom-configuration.md) for more information. |
207200

208201

209202
### `form` configuration reference
@@ -237,6 +230,9 @@ It controls the templates, how data is read from the master format, and how to a
237230
| ------------------- | -------------------------------------------------------------------------------------- |
238231
| `appearance` | The name of the appearance. Every content type requires one default appearance. |
239232
| `data_mapping` | Specifies how data is read from, saved to, and converted to and from the master format |
233+
234+
| Attribute | Description |
235+
| ------------------- | -------------------------------------------------------------------------------------- |
240236
| `preview_template` | Template used to display the element in the preview |
241237
| `render_template` | Template used to render the content type to the master format |
242238
| `reader` | Reads data for the content type from the master format |
@@ -246,11 +242,8 @@ It reads data based on the configuration specified in `data_mapping`.
246242

247243
**Example:**
248244
``` xml
249-
<appearance name="poster" default="true">
245+
<appearance default="true" name="poster" preview_template="Magento_PageBuilder/content-type/banner/poster/preview" render_template="Magento_PageBuilder/content-type/banner/poster/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
250246
<data_mapping/>
251-
<preview_template>Magento_PageBuilder/content-type/banner/poster/preview</preview_template>
252-
<render_template>Magento_PageBuilder/content-type/banner/poster/master</render_template>
253-
<reader>Magento_PageBuilder/js/component/format/read/configurable</reader>
254247
</appearance>
255248
```
256249

app/code/Magento/PageBuilder/docs/custom-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Use `additional_data` in your `Vendor/ModuleName/view/adminhtml/pagebuilder/cont
6464

6565
``` xml
6666
<additional_data>
67-
<arguments name="uploaderConfig" xsi:type="array">
67+
<item name="uploaderConfig" xsi:type="array">
6868
<item name="maxFileSize" xsi:type="object">Magento\PageBuilder\Model\Config\ContentType\AdditionalData\Provider\Uploader\MaxFileSize</item>
6969
<item name="allowedExtensions" xsi:type="string">jpg jpeg gif png</item>
7070
<item name="component" xsi:type="string">Magento_PageBuilder/js/form/element/image-uploader</item>
@@ -85,7 +85,7 @@ Use `additional_data` in your `Vendor/ModuleName/view/adminhtml/pagebuilder/cont
8585
<item name="validation" xsi:type="array">
8686
<item name="required-entry" xsi:type="boolean">true</item>
8787
</item>
88-
</arguments>
88+
</item>
8989
</additional_data>
9090
```
9191

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

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,12 @@ To add configuration for a new content type, create a file under the following l
5252
``` XML
5353
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Vendor_ModuleName:etc/content_type.xsd">
5454
<content_types>
55-
<type name="simple" sortOrder="35" translate="label">
56-
<label>Simple</label>
57-
<icon>icon-modulename-simple</icon>
58-
<component>Vendor_ModuleName/js/content-type</component>
59-
<form>modulename_simple_form</form>
60-
<group>general</group>
55+
<type name="simple" sortOrder="35" translate="label" label="Simple" icon="icon-modulename-simple" component="Vendor_ModuleName/js/content-type" form="modulename_simple_form" group="general">
6156
<allowed_parents>
6257
<parent name="row"/>
6358
</allowed_parents>
6459
<appearances>
65-
<appearance default="true" name="default">
60+
<appearance default="true" name="default" preview_template="Vendor_ModuleNameCustom/content-type/simple/default/preview" render_template="Vendor_ModuleNameCustom/content-type/simple/default/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
6661
<data_mapping>
6762
<elements>
6863
<element name="main" path=".">
@@ -81,9 +76,6 @@ To add configuration for a new content type, create a file under the following l
8176
</element>
8277
</elements>
8378
</data_mapping>
84-
<preview_template>Vendor_ModuleNameCustom/content-type/simple/default/preview</preview_template>
85-
<render_template>Vendor_ModuleNameCustom/content-type/simple/default/master</render_template>
86-
<reader>Magento_PageBuilder/js/master-format/read/configurable</reader>
8779
</appearance>
8880
</appearances>
8981
</type>
@@ -250,20 +242,13 @@ Now, let's add content type that can contain other content types. Create configu
250242
``` XML
251243
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
252244
<content_types>
253-
<type name="complex" sortOrder="35" translate="label">
254-
<label>Complex</label>
255-
<icon>icon-vendorname-complex</icon>
256-
<component>Magento_PageBuilder/js/content-type-collection</component>
257-
<preview_component>Magento_PageBuilder/js/content-type/preview-collection</preview_component>
258-
<content_component>Magento_PageBuilder/js/content-type/content-collection</content_component>
259-
<form>vendorname_complex_form</form>
260-
<group>general</group>
245+
<type name="complex" sortOrder="35" translate="label" labe="Complex" icon="icon-vendorname-complex" component="Magento_PageBuilder/js/content-type-collection" preview_component="Magento_PageBuilder/js/content-type/preview-collection" master_component="Magento_PageBuilder/js/content-type/content-collection" form="vendorname_complex_form" group="general">
261246
<allowed_parents>
262247
<parent name="row"/>
263248
<parent name="column"/>
264249
</allowed_parents>
265250
<appearances>
266-
<appearance default="true" name="default">
251+
<appearance default="true" name="default" preview_template="Vendor_ModuleName/content-type/complex/default/preview" render_template="Vendor_ModuleName/content-type/complex/default/master" reader="Magento_PageBuilder/js/master-format/read/configurable">
267252
<data_mapping>
268253
<elements>
269254
<element name="main" path=".">
@@ -282,9 +267,6 @@ Now, let's add content type that can contain other content types. Create configu
282267
</element>
283268
</elements>
284269
</data_mapping>
285-
<preview_template>Vendor_ModuleName/content-type/complex/default/preview</preview_template>
286-
<render_template>Vendor_ModuleName/content-type/complex/default/master</render_template>
287-
<reader>Magento_PageBuilder/js/master-format/read/configurable</reader>
288270
</appearance>
289271
</appearances>
290272
</type>
@@ -328,11 +310,11 @@ Now need to create preview and render templates.
328310

329311
Please also notice that we specified in configuration the following, to allow our content type accept other content types as children.
330312

331-
| Setting | Value |
332-
| ------------------- | ---------------------------------------------- |
333-
| `component` | Magento_PageBuilder/js/content-type-collection |
313+
| Setting | Value |
314+
| ------------------- | ----------------------------------------------------------- |
315+
| `component` | Magento_PageBuilder/js/content-type-collection |
334316
| `preview_component` | Magento_PageBuilder/js/content-type/preview-collection |
335-
| `content_component` | Magento_PageBuilder/js/content-type/content-collection |
317+
| `master_component` | Magento_PageBuilder/js/content-type/content-collection |
336318

337319
You can also specify `content_component` if you want to do modifications to observables used in master format templates.
338320

app/code/Magento/PageBuilder/docs/image-uploader.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ Use `additional_data` in your `<YourModule>/view/base/pagebuilder/content_type/<
5757
``` xml
5858
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
5959
<content_types>
60-
<type name="MyName" translate="label">
60+
<type name="MyName" translate="label" label="MyName" icon="icon-modulename-simple" component="Vendor_ModuleName/js/content-type" form="modulename_simple_form" group="general">
6161
...
6262
<additional_data>
63-
<arguments name="uploaderConfig" xsi:type="array">
63+
<item name="uploaderConfig" xsi:type="array">
6464
<item name="isShowImageUploadInstructions" xsi:type="boolean">false</item>
6565
<item name="isShowImageUploadOptions" xsi:type="boolean">true</item>
6666
<item name="maxFileSize" xsi:type="object">Magento\PageBuilder\Model\Config\ContentType\AdditionalData\Provider\Uploader\MaxFileSize</item>
@@ -83,7 +83,7 @@ Use `additional_data` in your `<YourModule>/view/base/pagebuilder/content_type/<
8383
<item name="validation" xsi:type="array">
8484
<item name="required-entry" xsi:type="boolean">true</item>
8585
</item>
86-
</arguments>
86+
</item>
8787
</additional_data>
8888
</type>
8989
</content_types>
@@ -127,4 +127,4 @@ Update the preview template file, `bluefoot/app/code/Magento/PageBuilder/view/ad
127127
</scope>
128128
...
129129
</div>
130-
```
130+
```

0 commit comments

Comments
 (0)