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


Section downloads lists files from a repeater. Chunk: pagebuilderpro_downloads. Requires PageBuilder Pro.

The file field exposes the media record url on the site.
| Field | Type | Required | Purpose |
|---|---|---|---|
title | text | no | Section title |
items | repeater | yes | Files |
items.title | text | yes | Name |
items.file | file | yes | File |
items.description | textarea | no | Description |
The list is ul.pb-downloads__list. file may be a string or an object with url. When the URL is empty, the title stays a <span>, not a link. An empty repeater leaves an empty list.
{
"title": "Files",
"items": [
{
"title": "Price list",
"file": { "url": "assets/files/price.pdf" },
"description": "PDF, 1 MB"
}
]
}Fenom chunk pagebuilderpro_downloads:
<section class="pb-section pb-section--downloads pb-downloads{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="downloads"{if $id} id="pb-{$id|escape}"{/if}>
<div class="pb-section__inner">
{if $title}<h2 class="pb-heading">{$title|escape}</h2>{/if}
<ul class="pb-downloads__list">
{foreach $items as $item}
{set $fileUrl = is_array($item.file) ? ($item.file.url ?: '') : ($item.file ?: '')}
<li class="pb-downloads__item">
{if $fileUrl}
<a href="{$fileUrl|escape}">{$item.title|escape}</a>
{else}
<span>{$item.title|escape}</span>
{/if}
{if $item.description}<p>{$item.description|escape}</p>{/if}
</li>
{/foreach}
</ul>
</div>
</section>