{$_modx->resource.longtitle ?: $_modx->resource.pagetitle}
{set $reviews = 'countComments' | snippet: ['docid' => $_modx->resource.id]}
{$_modx->getPlaceholder('sf.description') ?: $_modx->resource.desc}
{include 'msProductCustom.content'}
{include 'callOrder'}
{set $exclude = $.php.array_diff(($_modx->getPlaceholder('exclude') | split), [''])}
{set $exclude[] = $_modx->resource.id}
{'msProducts' | snippet: [
'parents' => 0,
'limit' => 5,
'where' => '{"parent": ' ~ $_modx->resource.parent ~'}',
'resources' => '-' ~ $exclude | join: ',-',
'sortby' => 'RAND()',
'tpl' => 'tpl.msProductsCustom.row',
'tplWrapper' => 'tpl.msProductsSimilar.outer',
'wrapIfEmpty' => 0
]}
{'msProducts' | snippet: [
'parents' => 0,
'link' => 1,
'master' => $_modx->resource.id,
'resources' => '-' ~ $exclude | join: ',-',
'includeThumbs' => 'small',
'tpl' => 'tpl.msProductsRelated.row',
'tplWrapper' => 'tpl.msProductsRelated.outer',
'wrapIfEmpty' => 0
]}
{'!productLinking' | snippet}
{/block}