© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group
Нужно допилить Ditto:
файл template.class.php:
if ($x % 2 && !empty($templates["alt"])) { $currentTPL = "alt"; }
Это шаблон для каждого второго элемента. Сделаем из него каждый второй через 3:
if (($x+1) % 3 && !empty($templates["alt"])) { $currentTPL = "alt"; }
Добавим каждый третий:
if ($x % 3 && !empty($templates["alt2"])) { $currentTPL = "alt2"; }
И пропишем в сниппете новый шаблон tplAlt2:
$templates = array( "default" => "@CODE".$_lang['default_template'], "base" => $tpl, "alt" => $tplAlt, "alt2" => $tplAlt2, "first" => $tplFirst, "last" => $tplLast, "current" => $tplCurrentDocument );
Будут шаблоны tpl, tplAlt и tplAlt2
if ($x % 5 && !empty($templates["five"])) {
$currentTPL = "five";
}[!Ditto? &tpl=`TPL-jc` &parents=`[*parent*]` &filter=`id,[*id*],2` &sortDir=`ASC`!]<li><a href="[~[+id+]~]" title="[+pagetitle+]. [+phx:if=`[+longtitle+]`:gt=`1`:then=`[+longtitle+].`:else=``+] Артикул: [+introtext+]"><img src="/[*item-img*]" width="102px" height="102px" alt="[+pagetitle+]. [+phx:if=`[+longtitle+]`:gt=`1`:then=`[+longtitle+].`:else=``+] Артикул: [+introtext+]" /></a></li>
