Fixed sort filter error when taxonomy is empty

This commit is contained in:
pmoreno.rodriguez 2023-10-28 22:12:13 +02:00
parent d298e75c67
commit 3a2466e787
2 changed files with 13 additions and 12 deletions

View file

@ -38,13 +38,16 @@
</div>
{% endif %}
{% if config.plugins.taxonomylist.enabled %}
<!-- Taxonomy list -->
<div>
<header>
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</div>
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
{% if taxlist %}
<!-- Taxonomy list -->
<div>
<header>
<h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
</header>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</div>
{% endif %}
{% endif %}
{% if config.plugins.feed.enabled %}
<!-- Syndicate -->

View file

@ -1,12 +1,10 @@
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
{% if taxlist %}
<ul class="menulink">
<li>
{% for tax,value in taxlist[taxonomy]|sort %}
{% for tax,value in taxlist[taxonomy] %}
{% if value is not empty %}
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
<a class="tags {{ active }}" rel="nofollow" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a>
{% endif %}
{% endfor %}
</li>
</ul>
{% endif %}