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

Pick several products in the inspector: the site renders a spec table with one column per product.
Информация
Requires PageBuilder Pro and miniShop3.
Products repeater or multirelation. Highlight differences marks differing values.
| Parameter | Value |
|---|---|
| key | product_comparison |
| Layer | Pro |
| Category | commerce (commerce) |
| Chunk | pagebuilderpro_product_comparison |
| Requires | pro, minishop3 |
Fill these fields in the section inspector. Field types are documented in the field types reference.
title) Type text. Optional.
products) Type multirelation. Required. Pick multiple resources. JSON stores resource IDs.
highlight_differences) Type yesno. Optional. Yes/no toggle.
pb-product-comparison table.
Example payload after save. Media, video, and map values may be enriched on output:
{
"title": "Section title",
"products": [
201,
202,
203
],
"highlight_differences": true
}Fenom chunk pagebuilderpro_product_comparison:
{var $productIds = $comparison_product_ids|default:''}
{var $listing = ''}
{if $productIds}
{var $listing = $modx->runSnippet('msProducts', [
'resources' => $productIds,
'limit' => 4,
'tpl' => 'pagebuilderpro_product_comparison_cell',
'includeVendorFields' => '*',
'includeOptions' => '*',
'withCurrency' => 1,
'showZeroPrice' => 1
])}
{/if}
<section
class="pb-section pb-section--product-comparison pb-product-comparison{if $highlight_differences} pb-product-comparison--diff{/if}{if $cssClass} {$cssClass|escape}{/if}"
data-pb-section="product_comparison"
{if $id} id="pb-{$id|escape}"{/if}
>
<div class="pb-section__inner pb-product-comparison__inner">
{if $title}
<h2 class="pb-heading pb-product-comparison__title">{$title|escape}</h2>
{/if}
{if $listing}
<div class="pb-product-comparison__scroll" tabindex="0" role="region" aria-label="{$title|default:'Product comparison'|escape}">
<div class="pb-product-comparison__grid">
{$listing}
</div>
</div>
{else}
<p class="pb-listing__empty">Select 2 to 4 products to compare.</p>
{/if}
</div>
</section>PageBuilderPro/core/components/pagebuilderpro/sections/product_comparison.json