Skip to content

Commit fc9c407

Browse files
committed
MC-5769: Complete content type tutorial
Updated missed references to old Vendor_Module names and added info about pagebuilder-content-type class to templates
1 parent f09548c commit fc9c407

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ The Quote example defines only one `appearance`. Therefore, by convention, set t
4444

4545
![Create config file](../images/step2-add-templates.png)
4646

47-
These files can be blank initially; they just need to exist in their proper location for now so we can reference them in the `appearance` element of our `quote.xml` configuration file as shown here:
47+
These files can be blank initially; they just need to exist in their proper location for now so we can reference them in the `appearance` element of our `example_quote.xml` configuration file as shown here:
4848

4949
```xml
5050
<appearances>
5151
<appearance name="default"
5252
default="true"
53-
preview_template="Vendor_Module/content-type/quote/default/preview"
54-
render_template="Vendor_Module/content-type/quote/default/master"
53+
preview_template="Example_PageBuilderQuote/content-type/example-quote/default/preview"
54+
render_template="Example_PageBuilderQuote/content-type/example-quote/default/master"
5555
reader="Magento_PageBuilder/js/master-format/read/configurable">
5656
<elements...>
5757
</appearance>
@@ -154,7 +154,7 @@ The `css` attribute applies CSS classes entered by users on the form to a templa
154154

155155
### class
156156

157-
Just as with any other html template, you can add your own classes to your template elements. Defining those classes for your content type is discussed in [Step 5: Add styles](step-5-add-styles.md).
157+
Just as with any other html template, you can add your own classes to your template elements. However, you should **always add the `pagebuilder-content-type` as the first class in the top node in your `preview.html` template** as shown for the Quote. Page Builder uses the `pagebuilder-content-type` class to visual indicators and mouseover effects to the Admin preview template, such as correctly positioning the options menu. Defining custom LESS/CSS classes for your content type is discussed in [Step 5: Add styles](step-5-add-styles.md).
158158

159159
### liveEdit
160160

docs/create-basic-content-type/step-3-add-components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ In your configuration file, reference your JavaScript component (`preview.js`) a
1414
```xml
1515
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1616
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
17-
<type name="example"
18-
label="Example"
17+
<type name="example_quote"
18+
label="Quote"
1919
component="Magento_PageBuilder/js/content-type"
20-
preview_component="Acme_PageBuilderQuote/js/content-type/acme_quote/preview"
20+
preview_component="Example_PageBuilderQuote/js/content-type/example_quote/preview"
2121
master_component="Magento_PageBuilder/js/content-type/master">
2222
...
2323
</type>
@@ -34,7 +34,7 @@ The following table describes each component-related attribute from the Quote co
3434

3535
## Location
3636

37-
Add them to your module here (`view/adminhtml/web/js/content-type/<content-type-name>/`):
37+
Add them to your module here (`view/adminhtml/web/js/content-type/example-quote/`):
3838

3939
![Create config file](../images/step3-add-component.png)
4040

0 commit comments

Comments
 (0)