
- MODX 3
- PHP 8.2
- Vue 3


The first block below the site header. Visitors see a title, short text, and a linked button. Add a background image or keep a flat background.

pagebuilder_hero ships with pb-hero markupTitle is required. The button renders only when both Button label and Button URL are set. Alignment switches text between left and center.
| Parameter | Value |
|---|---|
| key | hero |
| Layer | Free |
| Category | hero (hero) |
| Chunk | pagebuilder_hero |
| Requires | — |
Fill these fields in the section inspector. Field types are documented in the field types reference.
title) Type text. Required.
description) Type textarea. Optional.
button_label) Type text. Optional.
button_url) Type url. Optional.
background) Type image. Optional.
alignment) Type select. Optional. Dropdown with predefined options.
Renders pb-hero with title, description, CTA link (pb-button), and optional background via the image partial.
Example payload after save. Media, video, and map values may be enriched on output:
{
"title": "Section title",
"description": "Short block description for the first screen.",
"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"
},
"alignment": "left"
}Fenom chunk pagebuilder_hero:
{set $heroBg = is_array($background) ? ($background.url ?: '') : ($background ?: '')}
<section class="pb-section pb-section--hero pb-hero{if $alignment == 'center'} pb-hero--center{/if}{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="hero"{if $id} id="pb-{$id|escape}"{/if}{if $heroBg} style="--pb-hero-bg: url('{$heroBg|escape}')"{/if}>
<div class="pb-section__inner pb-hero__inner">
<h2 class="pb-hero__title">{$title|pb_text}</h2>
{if $description}
<div class="pb-hero__description">{$description|pb_text}</div>
{/if}
{if $button_label && $button_url}
<a class="pb-hero__button pb-button" href="{$button_url|pb_href|escape}">{$button_label|pb_text}</a>
{/if}
</div>
</section>