Skip to content

Commit 9d06d52

Browse files
author
Igor Melnikov
committed
MAGETWO-91200: Update documentation for PageBuilder EAP
- update documentation
1 parent f09ced5 commit 9d06d52

File tree

5 files changed

+46
-30
lines changed

5 files changed

+46
-30
lines changed

app/code/Magento/PageBuilder/docs/architecture-overview.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For storage (later master format) Page Builder uses XHTML with inline styles and
2121
To display Page Builder content on storefront Magento and third party systems need to do the following
2222

2323
1. Replace Magento directives (for instance {{image url=path/to/image.png}}).
24-
2. Add custom stylesheet.
24+
2. Add custom stylesheet to provide base styles that user can't edit (this includes styles for the content types like `slider`, `tabs`, `accordion`, etc).
2525
3. After content is rendered, on the frontend find all of content types that need to have widgets initialized (for instance, slider, tabs, etc) and load and initialize these widgets.
2626

2727
See more on [master format](master-format.md)
@@ -54,14 +54,18 @@ Page Builder also would be enabled in custom extensions where WYSIWYG is used.
5454

5555
Here is simplified data flow:
5656
1. Data read by reader `Magento_PageBuilder/js/master-format/read/configurable`.
57-
2. Data for each element (`border`, `border_color`, `border_width` etc) converted to internal format.
57+
2. Data for each element (`border`, `border_color`, `border_width` etc) converted to internal format by element converters.
5858
3. Data converted by mass converters, for more details see [converter interface](content-type-configuration.md).
5959
4. Content type created and `Magento_PageBuilder/js/data-store` populated with data.
60-
5. Data in data store modified and updated in data store.
60+
5. Data in data store modified in the form or using live edit.
6161
6. Data converted by mass converters.
62-
7. Converted by element converters.
62+
7. Converted by element data converters.
6363
8. Preview and master component observables updated.
64-
9. Attribute that editable with Page Builder updated, master format hen user saves pages data saved to the database.
64+
9. Editable with Page Builder entity attribute updated, when user saves the pages master format being saved to the database.
65+
66+
Mass converter modifies on data for all content type elements. For instance, if content type two elements, main and image. And data for these elements stored in the fields `border`, `border_color`, `border_width`, `background_image`. Mass converter will allow to modify all these fields. See more on how [data stored internally](#Data store).
67+
68+
Element converter modifies single field at a time.
6569

6670
## Data store
6771

app/code/Magento/PageBuilder/docs/content-type-configuration.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Content Type Configuration
22

33
**Note:**
4-
*We are revising configuration, format may change.*
4+
*We are revising configuration, format will change. We will publish draft of new improved configuration soon to get feedback.*
55

66
## Navigation
77

@@ -239,7 +239,8 @@ It reads data based on the configuration specified in `data_mapping`.
239239
</appearance>
240240
```
241241

242-
Every content type needs a default appearance.
242+
Every content type requires a default appearance to ensure that other modules are able to easily add more appearances.
243+
243244
Set the `default` attribute to "true" in an `appearance` node to set the default appearance for a content type.
244245

245246
### `data_mapping` configuration reference
@@ -248,11 +249,11 @@ Set the `default` attribute to "true" in an `appearance` node to set the default
248249
| ------------------ | ----------------------------------------------------------------------------------------------------- |
249250
| `elements` | The container for all the elements of the content type. |
250251
| `element` | The name of the element that contains data for the master format and the render and preview template. |
251-
| `style_properties` | specifies styles properties for the element in the master format |
252-
| `attributes` | specifies attributes for the element in master format |
253-
| `css` | specifies whether element has classes and in which variable they should be read |
254-
| `html` | specifies whether element has html content and in which variable they should be read |
255-
| `tag` | Allows you to read the tag value of the element and map it back to the master format. |
252+
| `style_properties` | Specifies styles properties for the element in the master format |
253+
| `attributes` | Specifies attributes for the element in master format |
254+
| `css` | Specifies whether element has classes and in which variable they should be read |
255+
| `html` | Specifies whether element has html content and in which variable they should be read |
256+
| `tag` | Allows you to read the tag name of the element and map it back to the master format. |
256257

257258
**Example:**
258259
``` xml
@@ -361,7 +362,7 @@ These style properties and attributes are applied in the preview and persisted i
361362

362363
### Html element
363364

364-
The `html` element allows you to read the value of the element in a property and map it back to the master format.
365+
The `html` element allows you to read the innerHTML of the element in a property and map it back to the master format.
365366

366367
``` xml
367368
<html name="message"/>
@@ -384,7 +385,7 @@ These classes are not read and do not appear on the form.
384385

385386
### Tag element
386387

387-
The `tag` element allows you to read the tag value of the element and map back to the master format.
388+
The `tag` element allows you to read the tag name of the element and map back to the master format.
388389

389390
``` xml
390391
<tag name="heading_type"/>

app/code/Magento/PageBuilder/docs/how-to-add-new-content-type.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Preview template `app/code/Vendor/ModuleName/view/adminhtml/web/template/content
8787
``` HTML
8888
<div class="pagebuilder-content-type pagebuilder-entity pagebuilder-entity-preview" event="{mouseover: onMouseOver, mouseout: onMouseOut}, mouseoverBubble: false">
8989
<div attr="data.main.attributes" ko-style="data.main.style" css="data.main.css" html="data.main.html"></div>
90+
<!-- Display context menu options for content type -->
9091
<render args="getOptions().template" />
9192
</div>
9293
```
@@ -174,6 +175,8 @@ In the `simple.xml` above we defined border attributes and form for component. L
174175
</form>
175176
```
176177

178+
Every form should have default appearance to allow other modules to add more appearances.
179+
177180
Attributes that we want to edit as part of the advanced section are defined in `pagebuilder_base_form`, so we can just extend it.
178181

179182
And to allow this form to be loaded in PageBuilder, let's create layout `Vendor/ModuleName/view/adminhtml/layout/pagebuildercustom_simple_form.xml`.

app/code/Magento/PageBuilder/docs/install.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@ Use this method if you are testing and evaluating PageBuilder for your Magento s
3131

3232
### Prerequisites
3333

34-
* Magento 2.3
35-
* Access to PageBuilder in Magento's composer repository
36-
* Composer
34+
* You submitted us MAGEID and github username and received access to 2.3 alpha and PageBuilder. If you didn't submit us github username with will send you an email and request it.
3735

3836
### Installation steps
3937

4038
1. Navigate to the root directory of your Magento application
41-
1. Add the PageBuilder package to the `composer.json` file using the following command:
42-
<!-- Need to confirm this is correct -->
39+
2. Install 2.3 alpha, run composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.3.0-alpha20
40+
Enter keys that you crated in your account (go to Marketplace / My Profile / Access Keys)
41+
3. Install Page Builder
4342
``` sh
44-
composer require magento/module-page-builder
43+
composer require magento/module-page-builder-commerce
4544
```
46-
1. Download and install PageBuilder into Magento using the following command:
45+
4. Enable Page Builder module using the following command:
4746
``` sh
4847
bin/magento setup:upgrade
4948
```
@@ -64,24 +63,33 @@ Do not use this installation method for evaluation or production instances.
6463
### Installation steps
6564

6665
1. Navigate to the root directory of your Magento application
67-
1. Clone the PageBuilder repository as a sub-directory using the following command:
66+
2. Clone the PageBuilder repository as a sub-directory using the following command:
6867
``` sh
6968
git clone [email protected]:magento/magento2-page-builder.git pagebuilder
7069
```
71-
1. Navigate to the `pagebuilder` directory and install PageBuilder dependencies using the following command:
72-
``` sh
73-
cd pagebuilder && yarn
74-
```
75-
1. Return to the root directory of your Magento application and navigate to `app/code/Magento`
76-
1. In the Magento modules directory, link the PageBuilder module code to the application code using the following command:
70+
3. Return to the root directory of your Magento application and navigate to `app/code/Magento`
71+
4. In the Magento modules directory, link the PageBuilder module code to the application code using the following command:
7772
``` sh
7873
ln -s ../../../pagebuilder/app/code/Magento/PageBuilder
7974
```
80-
1. Return to the root directory of your Magento application and install the PageBuilder module using the following command:
75+
5. Return to the root directory of your Magento application and install the PageBuilder module using the following command:
8176
``` sh
8277
bin/magento setup:upgrade
8378
```
8479

80+
## Installing Node.js dependencies
81+
82+
If you plan to contribute to Page Builder, you need to install Node.js dependencies to compile TypeScript.
83+
84+
Navigate to the `pagebuilder` directory and install PageBuilder dependencies using the following command:
85+
``` sh
86+
cd pagebuilder && yarn install
87+
```
88+
89+
Then you can run `npx gulp` to watch changes to TypeScript files and compile.
90+
91+
To check for TypeScript errors, you can run `npx tslint --fix -p tsconfig.json`.
92+
8593
## Activation
8694

8795
Follow these steps to activate PageBuilder in the Admin:

app/code/Magento/PageBuilder/docs/master-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ HTML & JavaScript content.
351351
<figure data-role="image" data-appearance="full-width" data-lightbox="false" style="...">
352352
<a href="" title="">
353353
<img src="" title="" alt="" class="pagebuilder-mobile-hidden" />
354-
<img src="" title="" alt="" class="pagebuilder-desktop-hidden" />
354+
<img src="" title="" alt="" class="pagebuilder-mobile-only" />
355355
</a>
356356
<figcaption>Image description</figcaption>
357357
</figure>

0 commit comments

Comments
 (0)