Плагин для фильтрации категорий, выводит необходимые категории.
Вывод формы для фильтрации
{exp:myfilter:form}
{exp:weblog:categories weblog="news" style="nested"}
<input name="category_id[]" type="checkbox" value="{category_id}" {exp:myfilter:checked id="{category_id}"} /> {category_name}
{/exp:weblog:categories}
<input type="submit" value="Save Filter" />
{/exp:myfilter:form}
Плагин сохраняет категории в куки пользователя.
Использование в шаблонах (необходимо включить php)
{exp:weblog:entries
weblog="news"
limit="15"
category="<? global $IN; echo $IN->GBL('myfilter', 'COOKIE');?>"}
=============================================================
Pair Tags:
=============================================================
Tag {exp:myfilter:form} - create form for save categories
PARAMETERS:
redirect - redirection URI (ex. redirect=“news/filters”)
refrash - refrash currect page (need for accept cookies)
=============================================================
Once Tags:
=============================================================
Tag {exp:myfilter:checked} - returned checked id ( ‘checked=“checked”’ or empty)
PARAMETERS:
id = category id
——————————————————————————————-
Tag {exp:myfilter:load} - returned cookie data (for developing)
=============================================================
in weblogs use
{exp:weblog:entries
weblog=“news”
limit=15”
category=”<? global $IN; echo $IN->GBL(‘myfilter’, ‘COOKIE’);?>”}
=============================================================
Exemple:
{exp:myfilter:form}
{exp:weblog:categories weblog=“news” style=“nested”}
<input name=“category_id[]” type=“checkbox” value=”{category_id}” {exp:myfilter:checked id=”{category_id}”} /> {category_name}
{/exp:weblog:categories}
<input type=“submit” value=“Save Filter” />
{/exp:myfilter:form}