Вывод идет так:
{'!pdoPage' | snippet : [
'parents' => $_modx->resource.id,
'limit' => 9,
'hideContainers' => true,
'includeTVs' => 'image,price,old_price',
'tplPageWrapper' => '@INLINE {include "file:inc/pager.wrap.tpl"}'
'tplPageActive' => '@INLINE {include "file:inc/pager.page.active.tpl"}',
'tvPrefix' => '',
'tpl' => '@INLINE
<div class="column">
{include "file:inc/catalog/product.tpl"}
</div>
'
$modx->runSnippet('!Sort')
]}
Снипет Sort:
<?php
$sort = $_GET['sort'];
if($sort == '') {
$output='&sortby=`{"menuindex":"ASC"}`';
} else {
$output = '&sortby=`{"'.$sort.'":"'.$_GET['dir'].'"}`';
}
return $output;
Пример ссылок:
<nav>
<span>Сортировать по:</span>
<a href="/vesyi-i-shagomeryi/vesyi-elektronnyie/?
sort=pagetitle&dir=DESC">Названию</a>
<a up="" href="/vesyi-i-shagomeryi/vesyi-elektronnyie/?
sort=price&dir=DESC">По цене</a>
</nav>
Павел Романов 13.02.2019 15:04 #
Дмитрий 13.02.2019 16:15 #
Павел Романов 13.02.2019 16:23 #
Но раз уж Fenom используете, то и сниппет не нужен (только обработку Fenom на страницах включите):