PageBuilder
Visual section builder for MODX 3. Draft and publish without overwriting resource content

Wide promo block: title, text, CTA, background, and optional miniShop3 product card.
Информация
Requires PageBuilder Pro and miniShop3.
Set copy and button. Product is optional: chunk may render a mini card.
| Parameter | Value |
|---|---|
| key | promo_banner |
| Layer | Pro |
| Category | commerce (commerce) |
| Chunk | pagebuilderpro_promo_banner |
| Requires | pro, minishop3 |
Fill these fields in the section inspector. Field types are documented in the field types reference.
title) Type text. Required.
text) Type textarea. Optional.
button_label) Type text. Optional.
button_url) Type url. Optional.
background) Type image. Optional.
product) Type relation. Optional. Pick one MODX resource in a search modal.
pb-promo-banner with CTA and optional product.
Example payload after save. Media, video, and map values may be enriched on output:
{
"title": "Section title",
"text": "Supporting text under the title.",
"button_label": "Learn more",
"button_url": "https://example.com/action",
"background": {
"url": "assets/images/example.jpg",
"id": 12,
"filename": "example.jpg",
"extension": "jpg",
"title": "example.jpg",
"width": 1920,
"height": 1080,
"type": "image"
},
"product": 201
}Fenom chunk pagebuilderpro_promo_banner:
{var $promoBg = is_array($background) ? ($background.url ?: '') : ($background ?: '')}
{var $productId = $pb_product_resource|default:($product_id|default:0)}
{var $listing = ''}
{if $productId}
{var $listing = $modx->runSnippet('msProducts', [
'parents' => 0,
'resources' => $productId,
'limit' => 1,
'tpl' => 'pagebuilderpro_ms3_product_row',
'includeVendorFields' => '*',
'includeOptions' => 'color,size',
'withCurrency' => 1,
'showZeroPrice' => 1
])}
{/if}
<section class="pb-section pb-section--promo-banner pb-promo-banner{if $promoBg} pb-promo-banner--media{/if}{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="promo_banner"{if $id} id="pb-{$id|escape}"{/if}{if $promoBg} style="--pb-hero-bg: url('{$promoBg|escape}')"{/if}>
<div class="pb-section__inner pb-promo-banner__inner">
<h2 class="pb-heading pb-promo-banner__title">{$title|escape}</h2>
{if $text}
<p class="pb-promo-banner__text">{$text|escape}</p>
{/if}
{if $listing}
<div class="pb-promo-banner__product">
{$listing}
</div>
{/if}
{if $button_label && $button_url}
<a class="pb-promo-banner__button pb-button" href="{$button_url|escape}">{$button_label|escape}</a>
{/if}
</div>
</section>PageBuilderPro/core/components/pagebuilderpro/sections/promo_banner.json