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-custom-content-type/step-1-add-configuration.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,7 @@ The `type` element defines the key properties of your content type. The attribut
70
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
71
|`sortOrder`| Optional. The listed order within the menu section. For example, `sortOrder=21` puts the content type third in the `Elements` menu section, after the content types with `sortOrder` values of 10 and 20. |
72
72
|`translate`| Identifies the attribute you want Magento to translate. Here, the `label` value is set for translation. |
Copy file name to clipboardExpand all lines: docs/create-custom-content-type/step-2-add-templates.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ The following table describes each `appearance` attribute in our example.
62
62
|`preview_template`| References the `preview.html` (the Admin preview template) for rendering the preview appearance of your content type on the stage within the Admin UI. |
63
63
|`master_template`| References the `master.html` (the master format storefront template) for rendering the appearance of your content type on the storefront for customers to see. |
64
64
|`reader`| Reads content type data from the master format. |
Copy file name to clipboardExpand all lines: docs/create-custom-content-type/step-3-add-components.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,7 @@ A description of each component-related attribute from the Quote configuration f
67
67
|`component`| Page Builder provides two component types to choose from: `content-type` and `content-type-collection`. Use `Magento_PageBuilder/js/content-type` for static content types that do not have children (like our Quote). Use `Magento_PageBuilder/js/content-type-collection` for content types that can contain children (container content types). You can also create and specify your own component implementations, provided they conform to the Page Builder interfaces. |
68
68
|`preview_component`| Optional. The `preview.js` file provides rendering logic to the Admin preview template. If your content type does not require any changes to Page Builder's standard rendering logic, you can omit this attribute from the the `type` element. When you omit the attribute, Page Builder will use `Magento_PageBuilder/js/content-type/preview` by default.<br /><br />However, if you want to make changes to the option menu for your content type, or other customize other user-interactivity in the Admin, you need to create your own preview component as we have done for the Quote content type. |
69
69
|`master_component`| Optional. The `master.js` file provides rendering logic to the master format storefront template. As with the `preview_component`, if your content type does not require any specific user-interactivity or other behavior when it's displayed in the storefront, you can simply omit this attribute from the the `type` element. When you omit the attribute, Page Builder will use `Magento_PageBuilder/js/content-type/master` by default. <br /><br />In the Quote configuration, the `master_component` attribute is only included for discussion. It simply points to the Page Builder default `master.js` component that would be used the attribute was omitted. |
|`form`| Name of the UI component form that provides the form editor for your content type. |
59
+
{:style="table-layout:auto"}
59
60
60
61
## The Quote form
61
62
@@ -71,6 +72,7 @@ The purpose of each field is described as follows:
71
72
| Author | A text input field for the author's name. |
72
73
| Description | A text input field to describe the author's title or origin of the quote. |
73
74
| CSS for Quote | A text input field for end-users to add CSS class names for styling the text in the Quote field. This option is detailed in [Step 5: Add styles](step-5-add-styles.md). |
75
+
{:style="table-layout:auto"}
74
76
75
77
The Quote form is shown in full here for you to copy into your `pagebuilder_example_form.xml` file, followed by descriptions of the key parts.
76
78
@@ -234,6 +236,7 @@ Page Builder requires fields to be grouped within named `<fieldset>` elements. F
|`name`| You can name your fieldset whatever you want. Currently, it has no significance for data binding. |
236
238
|`sortOrder`| Determines where Page Builder puts the fieldset within the editor in relation to other fieldsets. Page Builder sets the `sortOrder` for the `pagebuilder_base_form` fieldset to `90`. Setting your fieldset to a value less than that (such as `20`) will put your fieldset above both inherited fieldsets. A value greater than `90` will put your fieldset below the inherited fieldsets. |
239
+
{:style="table-layout:auto"}
237
240
238
241
### field
239
242
@@ -244,6 +247,7 @@ The `<field>` element creates the actual HTML form element as specified by the `
244
247
|`name`| The name of the field used for data bindings. |
245
248
|`sortOrder`| Determines where Page Builder puts the field within the fieldset in relation to other fields. |
246
249
|`formElement`| Determines the HTML form element to render for the field. |
250
+
{:style="table-layout:auto"}
247
251
248
252
### data source
249
253
@@ -277,6 +281,7 @@ The `<settings>` element defines the data scope, data type, and label to use for
277
281
|`dataScope`| Specifies the name of your input field for data binding. The `dataScope` node allows you to change the value of the `name` attribute for your input field. We do not need to change the field name value, so we keep our dataScope value the same as our field name. |
278
282
|`dataType`| Specifies the data type for the field's data. Common values are `text` and `boolean`. |
279
283
|`label`| Specifies the text label applied to the input field on the form. |
284
+
{:style="table-layout:auto"}
280
285
281
286
## Quote form layout
282
287
@@ -340,6 +345,7 @@ The `<element>` element provides a scope for the data bindings within it.
|`name`| Specifies the name of the element scope for the data binding when applied to template elements. In our example, the element name of `main` is used as the scope for binding styles and other attributes to the top-level `<div>` element in our template: `<div attr="data.main.attributes" ko-style="data.main.style">`|
348
+
{:style="table-layout:auto"}
343
349
344
350
#### style
345
351
@@ -353,6 +359,7 @@ The `<style>` element configures the bindings from the form style fields to the
353
359
|`preview_converter`| Converts the value for the preview. Used for cases where the conversion logic is different between the two views. |
354
360
|`storage_key`| Optional variable name for value in the data storage. If no value is provided, the `name` attribute will be used. |
355
361
|`reader`| Reader used for parsing attributes and properties out of the DOM. Should not be used with read-only persistence_mode. |
362
+
{:style="table-layout:auto"}
356
363
357
364
#### attribute
358
365
@@ -362,6 +369,7 @@ The `<attribute>` element provides a mechanism to attach DOM attributes to templ
|`name`| Specifies the name of the form field to bind to. |
381
+
{:style="table-layout:auto"}
373
382
374
383
For example, in our Quote configuration, we define an `<element>` named `quote` with a `<css>` element bound to an input field in our form named `quote_css`, as shown here:
375
384
@@ -415,6 +424,7 @@ The `<html>` element binds the HTML content entered in a form field. When the `<
|`name`| Specifies the name of the form field to bind to. |
427
+
{:style="table-layout:auto"}
418
428
419
429
For example, as with the previous `css` binding, the Quote configuration defines the `<element>` named `quote` with an `<html>` element that is bound to an input field in our form named `quote_text`, as shown here:
Copy file name to clipboardExpand all lines: docs/create-custom-content-type/step-6-add-icon.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ The CSS for integrating SVG and PNG images with the font icons used by Page Buil
50
50
|`width`| Sets the width of the content area that most closely matches the widths of Page Builder icon fonts. |
51
51
|`height`| Sets the height of the content area that most closely matches the widths of Page Builder icon fonts. |
52
52
|`margin-bottom`| Pulls the SVG or PNG image down within the panel container to more closely match the positioning of Page Builder's font icon. |
53
+
{:style="table-layout:auto"}
53
54
54
55
When deployed, your icon images are linked from `pub/static` as shown here:
55
56
@@ -77,7 +78,6 @@ The last step is to add our icon's class name to our config file. Previous to th
77
78
That's it. Now you can regenerate your static assets, empty your browser cache, and do a hard reload of your Admin page to see your new icon in the panel.
78
79
79
80
## Next
80
-
81
-
Congratulations! You just finished the last step in this tutorial. To wrap things up, find out [What's next](whats-next.md).
If you made it this far, congratulations! We hope this tutorial has been useful to learning the basics of creating a completely new content type for your end-users.
4
+
5
+
Here's a list of good next topics to learn more about customizing Page Builder to meet your needs:
6
+
7
+
-[Extend an existing content type](../extend-existing-content-type/overview.md)
8
+
-[How to customize the Page Builder panel](page-builder/docs/how-to/how-to-customize-panel.md)
9
+
-[How to add an image uploader](page-builder/docs/how-to/how-to-add-image-uploader.md)
10
+
-[How to add a storefront widget](page-builder/docs/how-to/how-to-add-storefront-widget.md)
11
+
-[How to add a custom toolbar](page-builder/docs/how-to/how-to-add-custom-toolbar.md)
12
+
-[How to add icons and images](page-builder/docs/how-to/how-to-add-icons-images.md)
13
+
-[How to change breakpoints](page-builder/docs/how-to/how-to-change-breakpoints.md)
Copy file name to clipboardExpand all lines: docs/extend-existing-content-type/step-2-extend-appearances.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,6 @@ The following table describes the elements in our extension configuration.
71
71
|`elements`| The grouping element that specifies one or more `element` nodes. |
72
72
|`element`| The element maps styles and other appearance extensions from the form editor to the HTML templates that render content on the Admin stage and storefront. We want our appearance styles to map to the `wrapper` element of the Banner's templates, so the element for each appearance extension is named `wrapper`. |
73
73
|`style`| The `style` element configures the bindings from the form field to the template elements. In this case, our style is applied to the `wrapper` element of the template. The style `name` represents the CSS `max-height` style. The `source` is the name of the form field you want the style bound to. Hint: The field name added in step 3 is `max-height`. |
Copy file name to clipboardExpand all lines: docs/extend-existing-content-type/step-3-extend-forms.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,6 @@ Some of the key elements are described here.
91
91
|`field`| The field `name` should match the CSS max-height style property, but in snake_case. Fields also have a `sortOrder` you can use to place your field above or below existing fields. The `formElement` for a field describes the HTML form type, such as input, checkbox, select, and more. |
92
92
|`argument`| Provides the way to add a `default` value to your field. Our default value is set to `300`. |
93
93
|`settings`| Provides the markup that gives your field a label, CSS styling, validation, and other properties as needed. |
94
-
95
94
{:style="table-layout:auto"}
96
95
97
96
After adding max-height field as previously shown, flush your cache, drag a banner to the Admin stage, open the editor, and see your new style property field being rendered in the Banner's form, as shown here:
0 commit comments