You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/create-basic-content-type/overview.md
+2-9
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,5 @@
1
1
# Overview
2
2
3
-
***
4
-
The development of this tutorial is currently **IN PROGRESS**.
5
-
6
-
***
7
-
8
3
Page Builder comes with several content types (controls) you can use to build your storefront pages. In this tutorial, you will add a new content type: a **Quote** control, which you can use to show customer testimonials or other types of quotations within your storefront.
As with most things in Magento, content types for Page Builder are housed in modules. The convention for naming modules that are solely dedicated to Page Builder, such as our Quote content type, is to prefix all the content type name with `PageBuilder`. This helps visually group content type modules within your vendor directory. Of course, this convention doesn't apply If you are adding a content type as part of an existing module.
@@ -35,14 +28,14 @@ After registering your module (`bin/magento setup:upgrade`) you will be ready to
35
28
36
29
The steps for creating the Quote content type are illustrated and described below. The reality is not quite this linear, but these steps do represent the basic phases and flow for building new Page Builder content types.
1.**Add configuration**: Create an XML file to define your content type and reference the other files that control the appearance and behavior of your content type.
41
34
2.**Add templates**: Create HTML templates that define the appearance of your content types on the Admin stage (`preview.html`) and the storefront (`master.html`).
42
35
3.**Add component**: Create a JavaScript file that defines the behavior of your content type on the Admin stage (`preview.js`) and the storefront (`master.js`).
43
36
4.**Add form**: Create a UI component form and a layout so Admin users can edit your content type within the Page Builder editor.
44
37
5.**Add styles**: Create LESS files to style your content types when rendered in the Admin UI and on the storefront.
45
-
6.**Add frontend widget**: Create a JavaScript file to control the UI behavior (user interactivity) of your content type on the storefront.
38
+
6.**Add an icon**: Create an SVG icon to visually identify your content type within the Page Builder panel.
Copy file name to clipboardexpand all lines: docs/create-basic-content-type/step-1-add-configuration.md
+14-19
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,5 @@
1
1
# Step 1: Add configuration
2
2
3
-
***
4
-
The development of this tutorial is currently **IN PROGRESS**.
5
-
6
-
***
7
-
8
3
The configuration file defines the settings and references to your content type files. You will return to this file often to update references and change settings during the development process.
9
4
10
5
Files referenced from the configuration include the HTML templates, the JavaScript components, the icon displayed for your content type in the Page Builder panel, and the UI component form for your content type editor within the Admin.
@@ -20,7 +15,7 @@ The name of your configuration file should reflect the name of your content type
The reason we suggest prefIxing your content type with your vendor name is to prevent Magento from merging your content type configuration file with another configuration file of the same name, or with a future content type published by Magento.
18
+
The reason we suggest prefixing your content type with your vendor name is to prevent Magento from merging your content type configuration file with another configuration file of the same name, or with a future content type published by Magento.
24
19
25
20
## The `example_quote` configuration
26
21
@@ -32,30 +27,30 @@ The following configuration is from the Quote content type. An overview of these
@@ -72,8 +67,8 @@ The `type` element defines the key properties of your content type. The attribut
72
67
|`preview_component`| Optional. JavaScript file (`preview.js`) that provides rendering logic within the Admin UI. The preview component does not need to specify the `.js` extension. If you don't provide the `preview_component`, Page Builder uses the base `Preview` component shown in the code: `Magento_PageBuilder/js/content-type/preview`. |
73
68
|`master_component`| Optional. JavaScript file (`master.js`) that provides rendering logic generic for all appearances of your content type when rendered on the storefront. The master component does not need to specify the `.js` extension. If you don't provide the `master_component`, Page Builder uses the base `Master` component shown in the code: `Magento_PageBuilder/js/content-type/master`. |
74
69
|`form`| UI component form that provides the form controls for editing your content type. |
75
-
|`icon`| Optional. PNG or SVG image displayed in the Page Builder panel alongside the label. If no icon value is provided, the content type will simply be displayed in the Page Builder panel without an icon. |
76
-
|`sortOrder`| Optional. The listed order within the menu group. For example, `sortOrder=21` puts the content type third in the `Elements` menu group, after the content types with `sortOrder`s of 10 and 20. |
70
+
|`icon`| Optional. Class name for your PNG or SVG image (or font icon) displayed in the Page Builder panel alongside the label. If you don't provide an icon value, the Page Builder panel displays the content type name without an icon. |
71
+
|`sortOrder`| Optional. The listed order within the menu group. For example, `sortOrder=21` puts the content type third in the `Elements` menu group, after the content types with `sortOrder` values of 10 and 20. |
77
72
|`translate`| Identifies the attribute you want Magento to translate. Here, the `label` value is set for translation. |
78
73
79
74
## The `children` element
@@ -92,7 +87,7 @@ The `parents` element determines if other content types can be a parent to your
92
87
93
88
```xml
94
89
<parentsdefault_policy="deny">
95
-
<parentname="column"policy="allow"/>
90
+
<parentname="column"policy="allow"/>
96
91
</parents>
97
92
```
98
93
@@ -108,10 +103,10 @@ Each of these views is defined as an `appearance` within the Banner configuratio
Copy file name to clipboardexpand all lines: docs/create-basic-content-type/step-2-add-templates.md
+35-39
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,5 @@
1
1
# Step 2: Add templates
2
2
3
-
***
4
-
The development of this tutorial is currently **IN PROGRESS**.
5
-
6
-
***
7
-
8
3
Content type templates are the HTML files (HTML fragments) that define how your content type *appears* on both the Admin stage and within your storefront. The combination of these templates (one `preview.html` and one `master.html`) creates an `appearance`. As discussed in the previous configuration step, you must have at least one `appearance` (two templates) defined for your content type. But like the Banner, you can define several appearances for users to choose from as shown here:
0 commit comments