Overview
The Pagebuilder allows creating static pages from blocks and editing them using a visual editor.
Each page consists of several different blocks. The blocks view and settings depend on web page requirements.
The page is created in the builder as a list of blocks with specific settings applied to each block. All data are saved in a Json file format.
Key Features
- No coding required
- Create static pages;
- Edit existing pages;
- Extend existing content types
- Ability to add new blocks;
- Live previews.
Subsystem component description
The builder is consisted of two main subsystems:
- Script with Creating logics;
- Script with Preview visualization logics.
The Builder runs on admin side so that it can receive data from VC platform and save changes made during editing of pages and themes.
The Preview script runs on Storefront, as only Storefront 'knows' which templates should be used to generate the html.
The scripts 'communicate' with each other via messages- window.postMessage()
Interaction of Pagebuilder Module Parts Diagram
Pagebuilder Interface Part
Add New Page
In order to add a new page, the user should go through the following steps:
- Go to More > Content module > select a Store and click on Pages widget;
- On 'Pages list' blade select 'Add' to add a new page;
- Choose 'Design page' on the new blade;
-
Fill out the following fields to create a new page:
-
Name- required field;
- Page layout name - select from drop down list (optional);
- Language - select from dropdown list (optional);
- Page header (optional);
- Permalink;
- Page metatitle (optional);
-
Page meta description (optional)
-
Click 'Create' button;
- The new page will be created.
Edit Page
- Select the page file from the list of pages;
- Click 'Open in Designer';
-
The system opens the Pagebuilder that consists of:
-
Editor;
- Preview area.
-
The Editor has two sections:
-
Blocks;
- Theme.
- In 'Blocks' section click on 'Blocks' to view the list of available blocks;
- Clicking on the '+' icon of the selected block will result in adding the block to the file;
- Clicking on the block in the 'Preview' area opens the block editor;
- Once the blocs are edited, click the 'Save' button to save the changes made;
- Click on the icons above the blocks in the 'Preview' area to view different screen resolutions;
- Select the 'Theme' section in the Editor to edit different theme parameters.
Add and Edit Page Demo
Page Preview
- Open Content module > select Store > clicks on Pages widget > select the page and click on 'Preview page' icon
- The system will display the page in Storefront with no possibility to edit the page.
Installation
Install Pagebuilder module
- Automatically: More > Modules > Available, select the CMS Page Builder module and click Install.
- Manually: download module ZIP package from https://github.com/VirtoCommerce/vc-module-pagebuilder/releases. In VC Manager go to More > Modules > Advanced, upload module package and click Install.
- Once the Pagebuilder module is installed, it will appear under 'Installed' modules.
-
The installed Pagebuilder module has two dependencies:
-
Content module;
- Core module.
Configuration
Assets relative path
Path in file storage where images will be uploaded
Store Preview Path
Relative url in store to preview blocks in page builder
AutoToken URL
Relative path to VC platform used to update the authorization toke.
Builder
The builder consists of two applications:
-
The first app is the Builder itself. The builder is located in ./cms-designer folder. The builder is run as follows:
-
For production:
npm run build
- For development:
1. The second part of the app is a script that allows page preview and starts on Storefront side. This script is located in ./store folder.npm run serve
npm run build:prod
npm run build