Skip to content

Instantly share code, notes, and snippets.

@morozVA
Last active January 3, 2018 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morozVA/a64e7cfa215bd6648cbc7dc899b33470 to your computer and use it in GitHub Desktop.
Save morozVA/a64e7cfa215bd6648cbc7dc899b33470 to your computer and use it in GitHub Desktop.
evo Ditto
[[Ditto? &tpl=`category_tpl` &parents=`[*id*]` &display=`all` &orderBy=`menuindex ASC`]]
фильтрация по TV чекбоксу
[!Ditto? &tpl=`brand_item` &tplLast=`brand_item_last` &where=`@SQL: AND (tvc.tmplvarid = '26' AND tvc.value = 'Да')` &parents=`17` &display=`all` &noResults=`Таких брендов нет` &orderBy=`menuindex ASC`!]
[!Ditto? &tpl=`item_catalog_TPL` &documents=`[!filter? &pageId=`[*id*]` &mode=`2`!]` &noResults=`По заданным параметрам ничего не найдено!` &display=`all` &orderBy=`menuindex ASC`!]
[+ditto_class+] С версии 2.1.1. Выводит классы even/odd, first/last и current
[+ditto_iteration+] Порядковый номер полученного документа в пределах текущей страницы
[+ditto_iteration:math=`?+1`+] Порядковый номер с единицы
&dateSource=`editedon` &dateFormat=`%d.%m.%Y`
&depth=`5`
&level=`3`
&documents=`1, 35`
&hideFolders=`1`
&noResults=`Документы не найдены`
&orderBy=`pagetitle ASC`
&randomize=`1`
&tplFirst - Шаблон для первого документа &tplFirst=`news_first`
Обрезка текста
[+summary+]
&extenders=`summary` &truncLen=`400` &truncText=`Подробнее...`
&paginate=`1`
[+next+] – Кнопка «Следующее»
[+previous+] – Кнопка «Предыдущее»
[+pages+] – Список страниц
[+totalPages+] – Общее количество страниц
[+start+] – Номер первой показываемой страницы
[+stop+] – Номер последней показываемой страницы
[+currentPage+] – Номер показываемой текущей страницы
[+total+] – Общее количество страниц
[!Ditto? &tpl=`news_tpl` &parents=`2` &id=`news` &paginate=`1` &display=`10`!]
<div class="pagination"> Страница [+news_currentPage+] из [+news_totalPages+] [+news_previous+][+news_pages+][+news_next+] </div>
countDocs = Подсчет количества документов.
[!Ditto? &tpl=`@CODE:[+count+]` &parents=`3,4,5` &extenders=`countDocs` &display=`1`!]
[[if?is=`[+ditto_iteration+]:=:2` &then=`</ul><ul>`]]
<li><a href="[~[+id+]~]">[+pagetitle+]</a></li>
[+id:is=`[*id*]`:then=`active`+]
&filter - Фильтр для отсеивания документов
Формат: поле,критерий,тип сравнения
Значение по умолчанию: NULL
Примечание: Используется формат `поле,критерий,тип сравнения` с запятой между значениями.
Список фильтров:
По умолчанию: NULL
Типы сравнения:
1 - != (не соответствует критерию)
2 - == (соответствует критерию)
3 - < (меньше критерия)
4 - > (больше критерия)
5 - <= (меньше или равен критерию)
6 - >= (больше или равен критерию)
7 - (не содержит текст критерия)
8 - (содержит текст критерия)
9 - case insenstive version of #7
10 - case insenstive version of #8
11 - checks leading character of the field
Может содержать несколько запросов, разделенных глобальным разделителем |.
Пример:
&filter=`id,10,2|id,20,2`
[+ditto_iteration:math=`(?+1)%3`:is=`0`:then=`<div class="clearfix hidden-xs"></div>`+]
[+ditto_iteration:math=`(?+1)%2`:is=`0`:then=`<div class="clearfix hidden visible-xs"></div>`+]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment