Skip to content

Commit 2f73706

Browse files
shrieleneenathanjosiah
authored andcommitted
MAGETWO-92021: [Tech debt] Improving dev experience for Products content-type
- Added documentation for method of storing master format as widget-directive - Added documentation for using product conditions in a content-type
1 parent 152fdda commit 2f73706

18 files changed

+428
-219
lines changed

app/code/Magento/PageBuilder/docs/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
[Content type configuration]: content-type-configuration.md
2626
[How to add a new content type]: how-to-add-new-content-type.md
2727
[Events]: events.md
28-
[Bindings]: bindings.md
2928
[Master format]: master-format.md
3029
[Visual select]: visual-select.md
30+
[Reuse product conditions in content types]: product-conditions.md
31+
[Store component master format as widget directive]: widget-directive.md
3132
[Custom Toolbar]: toolbar.md
3233
[Roadmap and Known Issues]: roadmap.m
3334

app/code/Magento/PageBuilder/docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ It replaces the default WYSIWYG Editor in the Admin area with a highly configura
1818
1. [Content type configuration]
1919
1. [How to add a new content type]
2020
1. [Events]
21-
1. [Bindings]
2221
1. [Master format]
2322
1. [Visual select]
23+
1. [Reuse product conditions in content types]
24+
1. [Store component master format as widget directive]
2425
1. [Custom Toolbar]
2526
5. [Roadmap and known issues]
2627

@@ -39,5 +40,7 @@ It replaces the default WYSIWYG Editor in the Admin area with a highly configura
3940
[Events]: events.md
4041
[Master format]: master-format.md
4142
[Visual select]: visual-select.md
43+
[Reuse product conditions in content types]: product-conditions.md
44+
[Store component master format as widget directive]: widget-directive.md
4245
[Custom Toolbar]: toolbar.md
4346
[Roadmap and Known Issues]: roadmap.md

app/code/Magento/PageBuilder/docs/architecture-overview.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
1. [Content type configuration]
1616
1. [How to add a new content type]
1717
1. [Events]
18-
1. [Bindings]
1918
1. [Master format]
2019
1. [Visual select]
20+
1. [Reuse product conditions in content types]
21+
1. [Store component master format as widget directive]
2122
1. [Custom Toolbar]
22-
1. [Add image uploader to content type]
2323
5. [Roadmap and known issues]
2424

2525
[Introduction]: README.md
@@ -35,11 +35,11 @@
3535
[Content type configuration]: content-type-configuration.md
3636
[How to add a new content type]: how-to-add-new-content-type.md
3737
[Events]: events.md
38-
[Bindings]: bindings.md
3938
[Master format]: master-format.md
4039
[Visual select]: visual-select.md
40+
[Reuse product conditions in content types]: product-conditions.md
41+
[Store component master format as widget directive]: widget-directive.md
4142
[Custom Toolbar]: toolbar.md
42-
[Add image uploader to content type]: image-uploader.md
4343
[Roadmap and Known Issues]: roadmap.md
4444

4545
## What is PageBuilder?
@@ -95,7 +95,7 @@ To revert back to using the default WYSIWYG, add the following entry to the fiel
9595
| ----------------- | --------------------- | -------------------------------------------------------------------------------------------------------------- |
9696
| Content type | `component` | View model responsible for rendering the preview and master format |
9797
| Preview component | `preview_component` | Contains preview specific logic that is generic for all appearances. Preview component is optional |
98-
| Master component | `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional |
98+
| Master component | `content_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional |
9999
| Data Store | | Contains data for the content type |
100100
| Appearance | `appearance` | Configuration for content type that defines look and behavior. Includes data mapping, form, templates, reader. |
101101
| Preview template | `preview_template` | Template used to display the element in the preview |
@@ -158,7 +158,7 @@ Appearances allow you to make the following customization on existing content ty
158158

159159
| File type | Location |
160160
| -------------------------|------------------------------------------------------------------------------------------------|
161-
| Content type components | `Vendor/ModuleName/view/adminhtml/web/js/content-type/master-type-name` |
161+
| Content type components | `Vendor/ModuleName/view/adminhtml/web/js/content-type/content-type-name` |
162162
| Content type templates | `Vendor/ModuleName/view/adminhtml/web/template/content-type/content-type-name/appearance-name` |
163163
| Styles | `Vendor/ModuleName/view/adminhtml/web/css/source/content-type/content-type-name` |
164164

@@ -167,4 +167,4 @@ Appearances allow you to make the following customization on existing content ty
167167

168168
[TypeScript]: https://www.typescriptlang.org/
169169
[master format]: master-format.md
170-
[content type]: how-to-add-new-content-type.md
170+
[content type]: how-to-add-new-content-type.md

app/code/Magento/PageBuilder/docs/bluefoot-data-migration.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
1. [Content type configuration]
1515
1. [How to add a new content type]
1616
1. [Events]
17-
1. [Bindings]
1817
1. [Master format]
1918
1. [Visual select]
19+
1. [Reuse product conditions in content types]
20+
1. [Store component master format as widget directive]
2021
1. [Custom Toolbar]
21-
1. [Add image uploader to content type]
2222
5. [Roadmap and known issues]
2323

2424
[Introduction]: README.md
@@ -34,11 +34,11 @@
3434
[Content type configuration]: content-type-configuration.md
3535
[How to add a new content type]: how-to-add-new-content-type.md
3636
[Events]: events.md
37-
[Bindings]: bindings.md
3837
[Master format]: master-format.md
3938
[Visual select]: visual-select.md
39+
[Reuse product conditions in content types]: product-conditions.md
40+
[Store component master format as widget directive]: widget-directive.md
4041
[Custom Toolbar]: toolbar.md
41-
[Add image uploader to content type]: image-uploader.md
4242
[Roadmap and known issues]: roadmap.md
4343

4444
## Overview
@@ -58,8 +58,8 @@ During the migration, Magento converts old BlueFoot content to its PageBuilder e
5858
The following content types are deprecated in PageBuilder:
5959

6060
* BlueFoot Slider - The Slider content type will be migrated as Advanced Slider.
61-
* BlueFoot Search - The content for the Search content type will be converted to HTML during migration.
62-
* BlueFoot Code - The content for the Code content type will be wrapped with the following tags:
61+
* BlueFoot Search - The content for the Search content block will be converted to HTML during migration.
62+
* BlueFoot Code - The content for the Code content block will be wrapped with the following tags:
6363
```
6464
<pre><code></code></pre>
6565
```
@@ -98,7 +98,7 @@ Your implementation must return a `string` that is compatible with the target co
9898
| Name | Description |
9999
| ----------------- | ----------------------------------------------- |
100100
| `$itemData` | Parsed BlueFoot JSON data ready for processing |
101-
| `$additionalData` | Additional data for rendering the content type |
101+
| `$additionalData` | Additional data for rendering the content block |
102102
103103
**Example: Heading renderer class implementation**
104104
@@ -177,13 +177,13 @@ class Heading implements RendererInterface
177177
```
178178

179179

180-
#### Children content types
180+
#### Children content blocks
181181

182182
Some BlueFoot content types, such as accordion and slider, can contain child content types.
183-
This can result in trees with deeply nested content types.
183+
This can result in trees with deeply nested content blocks.
184184

185185
During rendering, content types are processed from the bottom of the tree to the top.
186-
In other words, the system renders all child content types first and makes the results available to the immediate parent for placement.
186+
In other words, the system renders all child blocks first and makes the results available to the immediate parent for placement.
187187

188188
Use a virtual type of the following class to get the rendered content for a content type's children:
189189

@@ -201,7 +201,7 @@ This class accepts an array of paths, defined in the [`di.xml`] file, which prov
201201
</virtualType>
202202
```
203203

204-
After the system renders the children content types, the content is available to the parent renderer through `$additionalData['children']`.
204+
After the system renders the children blocks, the content is available to the parent renderer through `$additionalData['children']`.
205205

206206
**Note:**
207207
*This only applies to content types that contain children.*

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
1. **Content type configuration**
1919
1. [How to add a new content type]
2020
1. [Events]
21-
1. [Bindings]
2221
1. [Master format]
23-
1. [Visual select]
22+
1. [Visual select]
23+
1. [Reuse product conditions in content types]
24+
1. [Store component master format as widget directive]
2425
1. [Custom Toolbar]
25-
1. [Add image uploader to content type]
2626
5. [Roadmap and known issues]
2727

2828
[Introduction]: README.md
@@ -38,11 +38,11 @@
3838
[Content type configuration]: content-type-configuration.md
3939
[How to add a new content type]: how-to-add-new-content-type.md
4040
[Events]: events.md
41-
[Bindings]: bindings.md
4241
[Master format]: master-format.md
4342
[Visual select]: visual-select.md
43+
[Reuse product conditions in content types]: product-conditions.md
44+
[Store component master format as widget directive]: widget-directive.md
4445
[Custom Toolbar]: toolbar.md
45-
[Add image uploader to content type]: image-uploader.md
4646
[Roadmap and known issues]: roadmap.md
4747

4848
## Configuration
@@ -77,7 +77,7 @@ The following is an example of a content type configuration in `view/adminhtml/p
7777
<icon>icon-pagebuilder-image</icon>
7878
<component>Magento_PageBuilder/js/content-type</component>
7979
<preview_component>Magento_PageBuilder/js/content-type/banner/preview</preview_component>
80-
<master_component>Magento_PageBuilder/js/content-type/master</master_component>
80+
<content_component>Magento_PageBuilder/js/content-type/content</content_component>
8181
<form>pagebuilder_banner_form</form>
8282
<group>media</group>
8383
<allowed_parents>
@@ -197,7 +197,7 @@ The following is an example of a content type configuration in `view/adminhtml/p
197197
| `icon` | Icon displayed on the menu. |
198198
| `component` | View model responsible for rendering the preview and master format. |
199199
| `preview_component` | Helper component that contains preview specific logic. Helper component is optional. |
200-
| `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
200+
| `content_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
201201
| `form` | UI component form used for editing the content type |
202202
| `group` | Existing menu group that contains this content type. |
203203
| `allowed_parents` | List of parent content types that can accept this type as a child. |

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
1. [Content type configuration]
1616
1. [How to add a new content type]
1717
1. [Events]
18-
1. [Bindings]
1918
1. [Master format]
2019
1. [Visual select]
20+
1. [Reuse product conditions in content types]
21+
1. [Store component master format as widget directive]
2122
1. [Custom Toolbar]
22-
1. [Add image uploader to content type]
2323
5. [Roadmap and known issues]
2424

2525
[Introduction]: README.md
@@ -35,11 +35,11 @@
3535
[Content type configuration]: content-type-configuration.md
3636
[How to add a new content type]: how-to-add-new-content-type.md
3737
[Events]: events.md
38-
[Bindings]: bindings.md
3938
[Master format]: master-format.md
4039
[Visual select]: visual-select.md
40+
[Reuse product conditions in content types]: product-conditions.md
41+
[Store component master format as widget directive]: widget-directive.md
4142
[Custom Toolbar]: toolbar.md
42-
[Add image uploader to content type]: image-uploader.md
4343
[Roadmap and known issues]: roadmap.md
4444

4545

@@ -54,7 +54,7 @@ For example, if you want to load data from the backend, you can use objects, `xs
5454

5555
## Overview
5656

57-
To add customization to a Page Builder content type, you must:
57+
To add customization to a Page Builder content type:
5858
1. [Add additional data to the XML config](#additional-data)
5959
2. [Implement `ProviderInterface` for conversion](#conversion) (Optional, as it is only required if you're using `xsi:type="object"` to obtain dynamic configuration at runtime)
6060

@@ -65,8 +65,6 @@ Use `additional_data` in your `Vendor/ModuleName/view/adminhtml/pagebuilder/cont
6565
``` xml
6666
<additional_data>
6767
<arguments name="uploaderConfig" xsi:type="array">
68-
<item name="isShowImageUploadInstructions" xsi:type="boolean">false</item>
69-
<item name="isShowImageUploadOptions" xsi:type="boolean">true</item>
7068
<item name="maxFileSize" xsi:type="object">Magento\PageBuilder\Model\Config\ContentType\AdditionalData\Provider\Uploader\MaxFileSize</item>
7169
<item name="allowedExtensions" xsi:type="string">jpg jpeg gif png</item>
7270
<item name="component" xsi:type="string">Magento_PageBuilder/js/form/element/image-uploader</item>
@@ -132,7 +130,7 @@ In the `additional_data` XML config there is a `storeId` item with a `storeId` p
132130
<item name="storeId" xsi:type="object">\Magento\PageBuilder\Model\Config\ContentType\AdditionalData\Provider\StoreId</item>
133131
```
134132

135-
Custom configuration is injected into relevant content type block constructors, such as for the image block shown here, and accessed in `config.additional_data` within the content type type in `/app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/<your-content-type>/preview.js`:
133+
Custom configuration is injected into relevant content type block constructors, such as for the image block shown here, and accessed in `config.additional_data` within the content block type in `/app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/<your-content-type>/preview.js`:
136134

137135
``` js
138136
var uploaderConfiguration = Object.assign(

app/code/Magento/PageBuilder/docs/developer-documentation.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
1. [Content type configuration]
1616
1. [How to add a new content type]
1717
1. [Events]
18-
1. [Bindings]
1918
1. [Master format]
20-
1. [Visual select]
21-
1. [Custom Toolbar]
22-
1. [Add image uploader to content type]
19+
1. [Visual select]
20+
1. [Reuse product conditions in content types]
21+
1. [Store component master format as widget directive]
22+
1. [Custom Toolbar]
2323
5. [Roadmap and known issues]
2424

2525
**[Architecture overview]** - An overview of the PageBuilder module architecture.
@@ -40,12 +40,14 @@
4040

4141
**[Events]** - Reference documentation for PageBuilder events.
4242

43-
**[Bindings]** - Reference documentation for PageBuilder bindings.
44-
4543
**[Master format]** - Describes the master format for PageBuilder content types.
4644

4745
**[Visual select]** - Documentation on customizing the visual select field.
4846

47+
**[Reuse product conditions in content types]** - Documentation on using the product conditions rule tree for different content types.
48+
49+
**[Store component master format as widget directive]** - Documentation on storing a component's master format as a `widget-directive`.
50+
4951
**[Custom Toolbar]** - Documentation on adding a custom toolbar.
5052

5153
[Introduction]: README.md
@@ -62,7 +64,7 @@
6264
[Events]: events.md
6365
[Master format]: master-format.md
6466
[Visual select]: visual-select.md
67+
[Reuse product conditions in content types]: product-conditions.md
68+
[Store component master format as widget directive]: widget-directive.md
6569
[Custom Toolbar]: toolbar.md
66-
[Add image uploader to content type]: image-uploader.md
67-
[Roadmap and known issues]: roadmap.md
68-
[Bindings]: bindings.md
70+
[Roadmap and known issues]: roadmap.md

0 commit comments

Comments
 (0)