Skip to content

Commit e8b13eb

Browse files
committed
MC-5769: Complete content type tutorial
Removing plugin markup that breaks links in devdocs build
1 parent 1576738 commit e8b13eb

28 files changed

+93
-214
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/dev/tests/acceptance/vendor
66
static-error-log.xml
77
.DS_Store
8-
.vscode
8+
.vscode
9+
.history/

docs/configurations/block-chooser-configuration.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
# Block chooser <!-- omit in toc -->
1+
# Block chooser
22

3-
<!-- {% raw %} -->
4-
5-
## What's in this topic <!-- omit in toc -->
3+
## What's in this topic
64

75
This topic describes how to use the block chooser UI component for a custom content type.
86

9-
## Overview <!-- omit in toc -->
10-
11-
To use the block chooser component for your custom content type:
12-
13-
- [Configuration options](#configuration-options)
14-
- [Add the block select grid listing modal to content type XML](#add-the-block-select-grid-listing-modal-to-content-type-xml)
15-
- [Add component to content type XML](#add-component-to-content-type-xml)
16-
177
## Configuration options
188

199
Extends all `abstract` configuration.
@@ -137,5 +127,3 @@ To insert the block chooser UI component, `Magento_PageBuilder/js/form/element/b
137127
The `block_id` field pulls in the selected value from the modal.
138128

139129
Then the `block_chooser` component pulls in the value from the `block_id` field to ascertain when it should commence updating.
140-
141-
<!-- {% endraw %} -->

docs/configurations/content-type-configuration.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,14 @@ define([], function () {
498498
});
499499
```
500500

501+
### Form
502+
503+
Individual appearances may have different uiComponent forms in order to use different customizable content.
504+
505+
``` xml
506+
<form>pagebuilder_banner_collage_left_form</form>
507+
```
508+
501509
## Preview component settings
502510

503511
| Property | Description | Example |

docs/configurations/panel-configurations.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<!-- {% raw %} -->
2-
31
# Panel groups and configurations
42

53
By default, the Page Builder panel has four groups (Layout, Elements, Media, Add Content) and 16 content types as shown here:
@@ -20,10 +18,12 @@ These groups are defined in the Page Builder `group.xml` file and can be extende
2018

2119
This topic describes four ways to customize the Page Builder panel:
2220

23-
- [Rename panel groups](#rename-panel-groups)
24-
- [Reorder panel groups](#reorder-panel-groups)
25-
- [Add new panel groups](#add-new-panel-groups)
26-
- [Add content types to different panel group](#add-content-types-to-different-panel-groups).
21+
- [Panel groups and configurations](#panel-groups-and-configurations)
22+
- [Overview](#overview)
23+
- [Rename panel groups](#rename-panel-groups)
24+
- [Reorder panel groups](#reorder-panel-groups)
25+
- [Add new panel groups](#add-new-panel-groups)
26+
- [Add content types to different panel groups](#add-content-types-to-different-panel-groups)
2727

2828
{: .bs-callout .bs-callout-info }
2929
For the sake of the user experience, please don't forget the affect your panel configurations may have on the end user. User's should have access the most important content types first, so be careful how you reorder groups and content types within groups. We strongly encourage you to place your content types into the existing groups when possible, instead of creating your own group.
@@ -103,6 +103,3 @@ To add your content type to a new group or one of the existing groups, set your
103103
The result looks like this:
104104

105105
![Group with content type](../images/group-with-content-type.png)
106-
107-
108-
<!-- {% endraw %} -->

docs/configurations/server-side-rendered-previews.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
1-
# Server-side rendered previews <!-- omit in toc -->
2-
3-
<!-- {% raw %} -->
1+
# Server-side rendered previews
42

53
## What's in this topic
64

75
This topic describes how to use the `RenderPool` on the stage to render a backend [content type] preview.
86

97
Using this method, you can preview content types that cannot be rendered on the stage and require further backend processing to be previewed.
108

11-
The following steps utilize some example values; substitute those with values specific to your situation.
12-
13-
## Overview
14-
15-
To use the stage's `RenderPool` to produce a content type preview:
9+
The following steps utilize some example values. Substitute those with values specific to your situation.
1610

17-
- [What's in this topic](#whats-in-this-topic)
18-
- [Overview](#overview)
19-
- [Create a renderer](#create-a-renderer)
20-
- [Add the renderer to the pool](#add-the-renderer-to-the-pool)
21-
- [Submit an HTTP request to the preview controller](#submit-an-http-request-to-the-preview-controller)
22-
- [Render the element](#render-the-element)
23-
24-
## Create a renderer
11+
## Step 1: Create a renderer
2512

2613
Create a renderer that implements the renderer interface, `Magento\PageBuilder\Model\Stage\RendererInterface`:
2714

@@ -38,7 +25,7 @@ class AwesomeElement implements \Magento\PageBuilder\Model\Stage\RendererInterfa
3825
}
3926
```
4027

41-
## Add the renderer to the pool
28+
## Step 2: Add the renderer to the pool
4229

4330
Add the renderer you just created as an argument to the `Magento\PageBuilder\Model\Stage\RendererPool` type that specifies your custom content type role as the name in the `di.xml` file:
4431

@@ -52,7 +39,7 @@ Add the renderer you just created as an argument to the `Magento\PageBuilder\Mod
5239
</type>
5340
```
5441

55-
## Submit an HTTP request to the preview controller
42+
## Step 3: Submit an HTTP request to the preview controller
5643

5744
To invoke the renderer from the stage, submit an HTTP request to the PageBuilder preview controller:
5845

@@ -95,12 +82,10 @@ To invoke the renderer from the stage, submit an HTTP request to the PageBuilder
9582
});
9683
```
9784

98-
## Render the element
85+
## Step 4: Render the element
9986

10087
Your exact configuration and situation determine when, and how, you render the element.
10188

10289
Generally, you would perform this operation when the properties change, by overriding the `afterObservablesUpdated` method with this logic (as shown in the previous example).
10390

10491
To update the Document Object Model (DOM) to display your content, amend the JavaScript property that represents the HTML variable of your main element with the response from the HTTP request, `this.data.main.html(response.content);` from the previous example.
105-
106-
<!-- {% endraw %} -->

docs/configurations/storefront-configuration.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# Storefront customization <!-- omit in toc -->
1+
# Storefront customization
22

3-
<!-- {% raw %} -->
4-
You can customize PageBuilder content types by adding your own logic on the frontend.
3+
You can customize Page Builder content types by adding your own logic on the frontend, as described here.
54

6-
To add custom logic to content types:
7-
8-
- [Create a JavaScript widget](#create-a-javascript-widget)
9-
- [Add XML configuration](#add-xml-configuration)
10-
11-
## Create a JavaScript widget
5+
## Step 1: Create a JavaScript widget
126

137
Create a JavaScript widget in your module's `/view/frontend/web/js/content-type/{content-type-name}/appearance/{appearance-name}/widget.js` file:
148

@@ -48,7 +42,7 @@ define([
4842

4943
```
5044

51-
## Add XML configuration
45+
## Step 2: Add XML configuration
5246

5347
The XML configuration loads the widget on the frontend, and on the stage, so that you can preview content inside both the block and dynamic block content types.
5448

@@ -75,6 +69,4 @@ Add the following configuration to the `etc/di.xml` file in your custom module d
7569
</argument>
7670
</arguments>
7771
</type>
78-
```
79-
80-
<!-- {% endraw %} -->
72+
```

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ The development of this tutorial is currently **IN PROGRESS**.
55

66
***
77

8-
Out of the box, Page Builder comes with several content types (controls) that you can drag onto the stage to build your storefront pages, as shown below. In this topic, you will learn how to create your own content type for use within Page Builder.
8+
Page Builder comes with 16 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 quotations on a page.
99

1010
![Page Builder Content Types](../images/panel-horizontal.png)
1111

1212
## Prerequisites
1313

14-
Page Builder creates content types from modules. So this topic assumes you have a basic module structure in which to add your content type files.
14+
Page Builder creates content types from a module with UI components. So this topic assumes you have a basic module structure in which to add your content type files.
1515

1616
![Minimum module structure](../images/module-minimum-structure.png)
1717

@@ -32,5 +32,5 @@ The files you will need to create in order to build a basic content type are sho
3232

3333
![Before and after content type](../images/content-type-files.png)
3434

35-
## Tutorial
36-
This tutorial walks you through creating these files, starting with [Step 1: Add configuration](step-1-add-configuration.md).
35+
## Next
36+
[Step 1: Add configuration](step-1-add-configuration.md).

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Content types cannot be rendered without these templates. Add them to your modul
3030

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

33-
3433
## Create the `preview_template`
3534

3635
1. Create the `preview.html` file (as noted above) using the example content that follows.
@@ -60,7 +59,6 @@ Content types cannot be rendered without these templates. Add them to your modul
6059

6160
## Create the `master_template`
6261

63-
6462
```html
6563
<!--master.html-->
6664
<h2 attr="data.main.attributes"

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,4 @@ Add them to your module here (`view/adminhtml/web/js/content-type/<content-type-
3636

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

39-
40-
4139
## Create preview component

docs/create-basic-content-type/step-4-add-form.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,4 @@ In this example, let's create a form that extends `pagebuilder_base_form` to pro
181181
182182
[Insert descriptions]
183183
184-
## Create layout
185-
184+
## Create layout

0 commit comments

Comments
 (0)