Skip to content

Commit 479dc48

Browse files
committed
MC-5710: Beta docs tutorial
Add intro images to tutorial
1 parent aa69501 commit 479dc48

23 files changed

+93
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ We offer one method for installing PageBuilder:
4040
* [Step 3: Add components](docs/create-basic-content-type/step-3-add-components.md)
4141
* [Step 4: Add form editor](docs/create-basic-content-type/step-4-add-form-editor.md)
4242
* [Step 5: Add layout](docs/create-basic-content-type/step-5-add-layout.md)
43-
* [Step 6: Add styles and icons](docs/create-basic-content-type/step-6-add-styles-icons.md)
43+
* [Step 6: Add styles](docs/create-basic-content-type/step-6-add-styles.md)
4444
* [Step 7: Add frontend widget](docs/create-basic-content-type/step-7-add-frontend-widget.md)
4545
* [What's next](docs/create-basic-content-type/whats-next.md)
4646

docs/configurations/content-type-configuration.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Use the content type and group configuration to add new content types, extend ex
1616
| `appearances` | Appearance configuration. |
1717
| `is_visible` | Determines menu visibility for the component. System components should not be visible in the menu. Default value is true. |
1818
| `additional_data` | Allows to specify additional data for component, see [additional configurations](additional-configurations.md) for more information. |
19+
{:style="table-layout:auto"}
1920

2021
| Attribute | Description |
2122
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -26,6 +27,7 @@ Use the content type and group configuration to add new content types, extend ex
2627
| `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
2728
| `form` | UI component form used for editing the content type. |
2829
| `group` | Existing menu group that contains this content type. |
30+
{:style="table-layout:auto"}
2931

3032
### Examples
3133

@@ -155,6 +157,7 @@ The following is an example of a content type configuration in `view/adminhtml/p
155157
| `form` | UI component form used for editing the content type |
156158
| `group` | Existing menu group that contains this content type. |
157159
| `is_hideable` | Boolean that enables content types to be shown and hidden. Default is true. Set to false to prevent hiding of content type. |
160+
{:style="table-layout:auto"}
158161

159162
### `form`
160163

@@ -175,11 +178,13 @@ Parent policies will overwrite any child policies that are set.
175178
| Element | Description |
176179
| ------------------- | -------------------------------------------------------------------------------------- |
177180
| `parent` | The name of the parent content type that is allowed or denied. |
181+
{:style="table-layout:auto"}
178182

179183
| Attribute | Description |
180184
| ------------------- | -------------------------------------------------------------------------------------- |
181185
| `default_policy` | Allows or denies all content types to be parents unless specified as a parent element. |
182-
186+
{:style="table-layout:auto"}
187+
183188
**Example:**
184189
``` xml
185190
<parents default_policy="deny">
@@ -195,11 +200,13 @@ The `children` element specifies which content types can accept this type as a p
195200
| Element | Description |
196201
| ------------------- | -------------------------------------------------------------------------------------- |
197202
| `child` | The name of the child content type that is allowed or denied |
203+
{:style="table-layout:auto"}
198204

199205
| Attribute | Description |
200206
| ------------------- | -------------------------------------------------------------------------------------- |
201207
| `default_policy` | Allows or denies all content types to be children unless specified as a child element. |
202-
208+
{:style="table-layout:auto"}
209+
203210
**Example:**
204211
``` xml
205212
<children default_policy="allow">
@@ -217,12 +224,14 @@ It controls the templates, how data is read from the master format, and how to a
217224
| ------------------- | -------------------------------------------------------------------------------------- |
218225
| `appearance` | The name of the appearance. Every content type requires one default appearance. |
219226
| `data_mapping` | Specifies how data is read from, saved to, and converted to and from the master format |
227+
{:style="table-layout:auto"}
220228

221229
| Attribute | Description |
222230
| ------------------- | -------------------------------------------------------------------------------------- |
223231
| `preview_template` | Template used to display the element in the preview |
224232
| `render_template` | Template used to render the content type to the master format |
225233
| `reader` | Reads data for the content type from the master format |
234+
{:style="table-layout:auto"}
226235

227236
The default reader is `Magento_PageBuilder/js/component/format/read/configurable`.
228237
It reads data based on the configuration specified in `data_mapping`.
@@ -252,6 +261,7 @@ Set the `default` attribute to "true" in an `appearance` node to set the default
252261
| `css` | Specifies whether element has classes and in which variable they should be read |
253262
| `html` | Specifies whether element has html content and in which variable they should be read |
254263
| `tag` | Allows you to read the tag name of the element and map it back to the master format. |
264+
{:style="table-layout:auto"}
255265

256266
**Example:**
257267
``` xml
@@ -317,6 +327,7 @@ The name attribute in the element tags gets converted to a `data-element` attrib
317327
| `preview_converter` | Converts the value for the preview. Used for cases where the conversion logic is different between the two views. |
318328
| `persistence_mode` | Used for read/write properties. |
319329
| `reader` | Reader used for parsing attributes and properties out of the DOM. Should not be used with read-only persistence_mode. |
330+
{:style="table-layout:auto"}
320331

321332
You may optionally set a `reader` value in configuration, otherwise `Magento_PageBuilder/js/property/style-property-reader` will be used for properties, and `Magento_PageBuilder/js/property/attribute-reader` will be used for attributes. Both default readers accept `source` as a parameter, and will return that value.
322333

@@ -492,5 +503,6 @@ define([], function () {
492503
| Property | Description | Example |
493504
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------- |
494505
|`fieldsToIgnoreOnRemove`| array containing field names to ignore when evaluating whether an element has been configured. The default value is an empty array. | `["tab_name"]` |
506+
{:style="table-layout:auto"}
495507

496508
<!-- {% endraw %} -->

docs/configurations/panel-configurations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ These groups are defined in the Page Builder `group.xml` file and can be extende
1414
| `elements` | Elements | 10 | Groups common text and input elements |
1515
| `media` | Media | 20 | Groups visual and interactive elements |
1616
| `add_content` | Add Content | 30 | Groups dynamic storefront elements |
17+
{:style="table-layout:auto"}
1718

1819
## Overview
1920

docs/create-basic-content-type/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

35
# Overview
46

docs/create-basic-content-type/step-1-add-configuration.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

35
# Step 1: Add configuration
46

5-
Creating a configuration file is the first step to defining a new content type. It defines the properties and files that control the appearances and behaviors of a content type.
7+
The configuration file gives your content type its existence. It's where you set the name, display label, and references to the other files that define the appearance and behavior of your content type.
68

79
{: .bs-callout .bs-callout-info }
8-
This topic describes only a subset of configuration elements, enough to establish a fundamental understanding of the configuration file's role within a content type. For more details, refer to [Main configurations](../configurations/content-type-configuration.md) and [Additional configurations](../configurations/additional-configurations.md).
10+
Only a subset of configuration elements are described here (enough to understand the configuration file's role within a content type). For more details, refer to [Main configurations](../configurations/content-type-configuration.md) and [Additional configurations](../configurations/additional-configurations.md).
911

10-
## Create a configuration file
12+
## Location
1113

12-
Create a new configuration (XML) file in the following directory structure of your module: `view/adminhtml/pagebuilder/content_type/my-content-type.xml`.
14+
Add your configuration file here (`view/adminhtml/pagebuilder/content_type/`):
1315

14-
![Create config file](../images/create-config-file.png)
16+
![Create config file](../images/step1-add-config-file.png)
1517

16-
This config file should contain the following minimal requirements, described in the tables that follow:
18+
The file name should reflect the name of your content type, using underscores to separate multi-word names as needed.
19+
20+
## Example
21+
22+
The following configuration shows the minimal requirements for defining a content type, described in the tables that follow.
1723

1824
``` xml
1925
<?xml version="1.0"?>
@@ -63,6 +69,7 @@ The `<type>` node defines the key properties of your content type. The attribute
6369
| icon | Optional. PNG or SVG image displayed in the Page Builder panel alongside the label. |
6470
| is_hideable | Optional. Default `true`. Include it only when you want to set it to `false` to prevent the end-user from hiding your content type on demand, using a button (eye icon) in the options menu. A setting of false will remove the hide button from the options menu. |
6571
| translate | Identifies the attribute you want Magento to translate. Here, the `label` value is set for translation. |
72+
{:style="table-layout:auto"}
6673

6774
## The `appearance` node
6875

@@ -77,6 +84,7 @@ The `<appearance>` attributes are described as follows:
7784
| preview_template | `preview.html` - the HTML template for rendering the preview appearance of a content type within the Admin. |
7885
| render_template | `master.html` - the HTML template for rendering the storefront appearance of a content type for customers. |
7986
| reader | Reads data for the content type from the master format |
87+
{:style="table-layout:auto"}
8088

8189
All content types must have at least one `<appearance>` defined within the `<appearances>` collection.
8290

docs/create-basic-content-type/step-2-add-templates.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

35
# Step 2: Add templates
46

57
Page Builder templates are HTML files that define the appearance of content types within both the Admin UI (using the preview.html) and the storefront UI (using the master.html). Content types cannot be rendered without these templates, so let's create the ones already specified in the `<appearance>` element of our configuration file.
68

9+
## Location
10+
11+
Add your HTML templates here (`view/adminhtml/web/template/content-type/<content-type-name>/default/`):
12+
13+
![Create config file](../images/step2-add-templates.png)
14+
715
``` xml
816
<appearance name="default"
917
default="true"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

35
# Step 3: Add components
46

57
Components are JavaScript files that define the behavior of your content type within the Admin UI stage (using preview.js) and the storefront UI (using master.js).
68

9+
## Location
10+
11+
Add your preview component here (`view/adminhtml/web/js/content-type/<content-type-name>/`):
12+
13+
![Create config file](../images/step3-add-component.png)
14+
715
1. Add a preview.js file to ...
816

917
<!-- {% endraw %} -->
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

3-
# Step 4: Add form editor
5+
# Step 4: Add form
46

57

8+
## Location
9+
10+
Add your form UI component here (`view/adminhtml/web/js/content-type/<content-type-name>/`):
11+
12+
![Create config file](../images/step4-add-form-editor.png)
13+
614
<!-- {% endraw %} -->
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<!-- {% raw %} -->
2+
{: .bs-callout .bs-callout-warning }
3+
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
24

35
# Step 5: Add layout
46

57

8+
## Location
9+
10+
Add your form layout here (`view/adminhtml/layout/`):
11+
12+
![Create config file](../images/step5-add-layout.png)
13+
14+
15+
616
<!-- {% endraw %} -->

docs/create-basic-content-type/step-6-add-styles-icons.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)