Page Builder is a special page editing mode that separates text editing from structural editing. Instead of exposing the full HTML of a page to editors, it presents the page as a set of composable blocks. This page explains how to create those blocks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/webjetcms/webjetcms/llms.txt
Use this file to discover all available pages before exploring further.
How Page Builder works
In Page Builder mode the page structure is built from blocks organised as:- Section (
<section>) — the outermost structural unit, marked in blue in the editor - Container (
<div class="container">) — holds rows inside a section, marked in red - Row (
<div class="row">) — standard Bootstrap row, not directly editable in Page Builder - Column (
<div class="col-*">) — the editable content unit, marked in green
Page Builder mode is set per template group or per template in the Page editor type field. Set it to Page Builder to activate this mode for pages using that template.
Block directory structure
Blocks are loaded automatically from:Block types in the editor
| Directory | Editor colour | When to use |
|---|---|---|
section | Blue | Full-width horizontal sections with background, hero areas, feature rows |
container | Red | Content groups inside a section that need a fixed-width wrapper |
column | Green | Individual column content: text, image + text combos, cards |
content | Yellow insert bar | Small inline elements: buttons, quotes, callouts |
Block HTML structure
Each block is a plain HTML file. Use Bootstrap grid classes for columns. A complete section block example:Block ID (data-pb-id)
After a block is inserted into a page, WebJET sets the data-pb-id attribute on the inserted top-level element (e.g. the <section> or the <div class="container">). The value is the path to the HTML file encoded in Base64:
pb-basic-TYPE.INDEX where the type values are: 0 = column, 1 = container, 2 = section, 4 = content.
Block name and tags
Create apagebuilder.properties file (UTF-8) in a block group subdirectory to set its display name, icon, and search tags:
pagebuilder_en.properties for English.
If you build blocks from PUG source files, make sure your
build-pug.js script copies .properties files for directories matching /pagebuilder/:Thymeleaf support in blocks
Blocks are inserted into the page without full Thymeleaf processing (the HTML is copied directly into the editor). However, the following attributes are executed at insert time:| Attribute | Supported |
|---|---|
data-iwcm-write | Yes — application inclusion |
data-iwcm-remove | Yes — application inclusion |
data-th-src | Yes — image source |
data-th-href | Yes — link href |
${ninja.temp.basePath}, ${ninja.temp.basePathAssets}, ${ninja.temp.basePathCss}, ${ninja.temp.basePathJs}, ${ninja.temp.basePathPlugins}, ${ninja.temp.basePathImg}.
Editable and non-editable elements
Page Builder automatically initialises CKEditor on:- Elements with classes matching
col-* - Elements with CSS class
pb-editable
| Class | Effect |
|---|---|
pb-editable | Force-enable CKEditor on any element |
pb-not-editable | Disable CKEditor on this element and its children |
pb-always-mark | Show the Page Builder toolbar for a non-editable element |
pb-not-section | Exclude element from being treated as a section |
pb-not-container | Exclude element from being treated as a container |
pb-not-column | Exclude element from being treated as a column |
pb-custom-container | Treat element as a container even without class="container" |
Unique IDs in blocks
For elements that require a uniqueid (e.g. carousels, modals), use the placeholder __ID__. It is replaced with a random timestamp value each time the block is inserted:
Supporting JavaScript file
To customise Page Builder behaviour for a project, create the file:pagesupport.js. Use it to override grid selectors, colour swatches, breakpoints, and other Page Builder options:
Page Builder events
Listen to Page Builder events viawindow.addEventListener:
| Event | When it fires |
|---|---|
WJ.PageBuilder.loaded | After the page is loaded in the editor |
WJ.PageBuilder.gridChanged | When the grid changes (block added, moved, removed) |
WJ.PageBuilder.styleChange | When a block’s style/class changes |
WJ.PageBuilder.newElementAdded | When a new element is inserted |
WJ.PageBuilder.elementDuplicated | When an element is duplicated |
WJ.PageBuilder.elementMoved | When an element is moved |
Preview images for blocks
For each HTML block file, place an image with the same base name alongside it (e.g.contact01.html and contact01.jpg). The image is shown in the block picker in the Page Builder UI.
Images can be generated automatically by running the script /components/grideditor/phantom/generator.jsp, which requires PhantomJS installed and its path set in the configuration variable grideditorPhantomjsPath.
Customising existing applications
To modify the output of an existing WebJET application (e.g. the search or banner component) without risking overwrites on update:Locate the original file
Find the file you want to modify, for example
/components/search/search.jsp.Copy it to your install-name path
Create a copy at
/components/INSTALL_NAME/search/search.jsp where INSTALL_NAME matches the installName configuration constant./apps/, the same pattern applies:
Built-in advanced block patterns
Tabs
Mark a<ul> with pb-autotabs to generate Bootstrap tabs automatically from the container structure. Each container becomes a tab; the tab label is taken from a child element with class pb-tab-title or the container’s title attribute.
Accordion
Mark the container withpb-autoaccordion to enable automatic accordion generation. Each nested card container becomes an accordion item.
Auto menu
Addpb-automenu to a <ul> to generate navigation entries from all <section> elements on the page. The menu item label is taken from the element with class section-title, then h1, then the title attribute of the section.
Mark sections you want to exclude from the menu with pb-not-automenu.
