
PageBuilder
Visual section builder for MODX 3: draft and publish without overwriting resource content
- MODX 3
- PHP 8.2
- Vue 3


Version: Pro.
Several photos in one field. Each photo has its own alt text and caption. After save, the file gets a URL, width, and height, the same as image. The type is in PageBuilder Pro.
One photo is easier with image. In the chunk, loop the array and use the photo URL: {$slide.url}.
{
"name": "shots",
"type": "gallery",
"label": "Gallery",
"groups": true,
"tab": "Content",
"width": 100,
"active": true
}Array of media objects (images, video, PDF, and more).
Key shots in the section data: array of media objects after enrich:
{
"shots": [
{
"url": "assets/images/hero.jpg",
"id": 12,
"path": "assets/images/",
"filename": "hero.jpg",
"extension": "jpg",
"name": "hero",
"title": "hero.jpg",
"width": 1920,
"height": 1080,
"size": 245760,
"type": "image",
"description": "Frame caption",
"preview": "assets/images/hero.jpg",
"groups": [
"main",
"slider"
]
},
{
"url": "assets/files/catalog.pdf",
"id": 34,
"path": "assets/files/",
"filename": "catalog.pdf",
"extension": "pdf",
"name": "catalog",
"title": "catalog.pdf",
"size": 1048576,
"type": "pdf",
"groups": "docs"
}
]
}groups: string or array when enabled in the field schema.{foreach $shots as $image}
[[$pagebuilder_partial_image?
&image=`{$image}`
&alt=`{$image.title}`
&class=`pb-gallery__media`
]]
{/foreach}{foreach $shots as $image}
{include 'pagebuilder_partial_image' image=$image alt=$image.title class='pb-gallery__media'}
{/foreach}For fields with name that are stored in the section data:
| Key | Type | Role | CMP |
|---|---|---|---|
tab | string | Group subtitle in the inspector | yes |
width | 25–100 | Field width as % of the row (flex) | yes |
description | string | Hint under the label | yes |
default | any | Initial value for a new section | yes |
active | bool | false hides the field in the inspector | yes |
required | bool | Required on publish (draft still saves) | yes |
groups: true: groups on gallery items.See fields overview.