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/configurations/content-type-configuration.md
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Use the content type and group configuration to add new content types, extend ex
16
16
|`appearances`| Appearance configuration. |
17
17
|`is_visible`| Determines menu visibility for the component. System components should not be visible in the menu. Default value is true. |
18
18
|`additional_data`| Allows to specify additional data for component, see [additional configurations](additional-configurations.md) for more information. |
|`preview_template`| Template used to display the element in the preview |
224
232
|`render_template`| Template used to render the content type to the master format |
225
233
|`reader`| Reads data for the content type from the master format |
234
+
{:style="table-layout:auto"}
226
235
227
236
The default reader is `Magento_PageBuilder/js/component/format/read/configurable`.
228
237
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
252
261
|`css`| Specifies whether element has classes and in which variable they should be read |
253
262
|`html`| Specifies whether element has html content and in which variable they should be read |
254
263
|`tag`| Allows you to read the tag name of the element and map it back to the master format. |
264
+
{:style="table-layout:auto"}
255
265
256
266
**Example:**
257
267
```xml
@@ -317,6 +327,7 @@ The name attribute in the element tags gets converted to a `data-element` attrib
317
327
|`preview_converter`| Converts the value for the preview. Used for cases where the conversion logic is different between the two views. |
318
328
|`persistence_mode`| Used for read/write properties. |
319
329
|`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"}
320
331
321
332
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.
|`fieldsToIgnoreOnRemove`| array containing field names to ignore when evaluating whether an element has been configured. The default value is an empty array. |`["tab_name"]`|
Copy file name to clipboardExpand all lines: docs/create-basic-content-type/step-1-add-configuration.md
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,25 @@
1
1
<!-- {% 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.
2
4
3
5
# Step 1: Add configuration
4
6
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.
6
8
7
9
{: .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).
9
11
10
-
## Create a configuration file
12
+
## Location
11
13
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/`):
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.
17
23
18
24
```xml
19
25
<?xml version="1.0"?>
@@ -63,6 +69,7 @@ The `<type>` node defines the key properties of your content type. The attribute
63
69
| icon | Optional. PNG or SVG image displayed in the Page Builder panel alongside the label. |
64
70
| 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. |
65
71
| translate | Identifies the attribute you want Magento to translate. Here, the `label` value is set for translation. |
72
+
{:style="table-layout:auto"}
66
73
67
74
## The `appearance` node
68
75
@@ -77,6 +84,7 @@ The `<appearance>` attributes are described as follows:
77
84
| preview_template |`preview.html` - the HTML template for rendering the preview appearance of a content type within the Admin. |
78
85
| render_template |`master.html` - the HTML template for rendering the storefront appearance of a content type for customers. |
79
86
| reader | Reads data for the content type from the master format |
87
+
{:style="table-layout:auto"}
80
88
81
89
All content types must have at least one `<appearance>` defined within the `<appearances>` collection.
Copy file name to clipboardExpand all lines: docs/create-basic-content-type/step-2-add-templates.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,17 @@
1
1
<!-- {% 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.
2
4
3
5
# Step 2: Add templates
4
6
5
7
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.
6
8
9
+
## Location
10
+
11
+
Add your HTML templates here (`view/adminhtml/web/template/content-type/<content-type-name>/default/`):
The development of this tutorial is currently **IN PROGRESS**, **INCOMPLETE**, and potentially **INCORRECT**. The expected completion time is Nov. 27.
2
4
3
5
# Step 3: Add components
4
6
5
7
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).
6
8
9
+
## Location
10
+
11
+
Add your preview component here (`view/adminhtml/web/js/content-type/<content-type-name>/`):
0 commit comments