mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
Fixed sort filter error when taxonomy is empty
This commit is contained in:
parent
d298e75c67
commit
3a2466e787
2 changed files with 13 additions and 12 deletions
|
@ -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 -->
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Reference in a new issue