|
1 | 1 | # Overview
|
2 | 2 |
|
3 |
| -{: .bs-callout .bs-callout-info } |
| 3 | +*** |
4 | 4 | The development of this tutorial is currently **IN PROGRESS**.
|
5 | 5 |
|
6 |
| -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. |
| 6 | +*** |
| 7 | + |
| 8 | +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. |
7 | 9 |
|
8 | 10 | 
|
9 | 11 |
|
10 |
| -## Prerequisites |
| 12 | +## Quote preview |
| 13 | + |
| 14 | +The following screenshot shows three instances of the Quote control you will build in this tutorial: |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +And the same three Quote controls are shown rendered here on a mock testimonial page in the storefront: |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
11 | 23 |
|
12 |
| -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. |
| 24 | +## Quote module |
| 25 | + |
| 26 | +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. |
| 27 | + |
| 28 | +Applying this convention to the module for our Quote content type, we get the name `PageBuilderQuote`, and can set up our module as shown here: |
13 | 29 |
|
14 | 30 | 
|
15 | 31 |
|
16 |
| -## Overview |
| 32 | +After registering your module (`bin/magento setup:upgrade`) you will be ready to begin this tutorial by following the content type creation process outlined next. |
| 33 | + |
| 34 | +## Quote creation |
| 35 | + |
| 36 | +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. |
17 | 37 |
|
18 | 38 | 
|
19 | 39 |
|
20 |
| -1. **Add configuration**: Create an XML file to setup all the other files that control the appearances and behaviors of your content type. |
21 |
| -2. **Add templates**: Create HTML files that define the appearance of your content types on the Admin stage (preview.html) and the storefront (master.html). |
22 |
| -3. **Add component**: Create a JavaScript file that define the behavior of your content type on the Admin stage (preview.js) and the storefront (master.js). |
23 |
| -4. **Add form**: Create a UI component form (XML file) and layout so users can edit your content type. |
| 40 | +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 | +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 | +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 | +4. **Add form**: Create a UI component form and a layout so Admin users can edit your content type within the Page Builder editor. |
24 | 44 | 5. **Add styles**: Create LESS files to style your content types when rendered in the Admin UI and on the storefront.
|
25 | 45 | 6. **Add frontend widget**: Create a JavaScript file to control the UI behavior (user interactivity) of your content type on the storefront.
|
26 | 46 |
|
27 |
| -## Content type files |
| 47 | +## Quote file structure |
28 | 48 |
|
29 |
| -The files you will need to create in order to build a basic content type are shown here. |
| 49 | +Before we get started, take a look at what you will be building. The directory structure on the left shows the basic `PageBuilderQuote` module you will start with (as previously described). The directory structure on the right shows all the files you will add to the `PageBuilderQuote` module throughout this tutorial, labeled by the steps in the process. |
30 | 50 |
|
31 | 51 | 
|
32 | 52 |
|
33 |
| -## Tutorial |
34 |
| -This tutorial walks you through creating these files, starting with [Step 1: Add configuration](step-1-add-configuration.md). |
| 53 | +## Conventions |
| 54 | + |
| 55 | +The `PageBuilderQuote` module structure represents an overview of the conventions used for content types. Many of these conventions are simply those defined for developing UI components. However, the conventions specific to Page Builder content types appropriately start within the directories called `content_type` or `content-type`. Page Builder instantiates a content type from the files defined within these directories. We will discuss these content type conventions within each step of the process. |
| 56 | + |
| 57 | +## Next |
| 58 | +[Step 1: Add configuration](step-1-add-configuration.md) |
0 commit comments