zpwiki/themes/knowledge-base/templates/partials/frontlist.html.twig

16 lines
697 B
Twig
Raw Permalink Normal View History

{% set articles = taxonomy.findTaxonomy({'category': category}).order('title') %}
<section class="topiclist">
<h2>
{# Check to see if a dedicated category page exists #}
{% set slug = category|hyphenize|url_encode %}
{% set p = page.find('/categories/'~slug) %}
{% if p == null %}
<a href="{{ base_url }}/taxonomy?name=category&amp;val={{ category|url_encode }}">{{ category|e }}</a>
{% else %}
<a href="{{ base_url }}/categories/{{slug}}">{{ category|e }}</a>
{% endif %}
<span class="count">({{ articles|length }})</span>
</h2>
{% include 'partials/topiclist.html.twig' with {'articles': articles, 'maxcount': maxcount} %}
</section>