dont display zero length popular and latest
This commit is contained in:
parent
7b4a270078
commit
febce03328
@ -82,14 +82,15 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set popular = tmplst %}
|
||||
{% if popular|length > 0 %}
|
||||
<h1><span>{{ 'POPULAR_ARTICLES'|t }}</span></h1>
|
||||
{% include 'partials/topiclist.html.twig' with {'articles': popular, 'maxcount': maxcount} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if grav.theme.config.params.sidebar.show.latest %}
|
||||
<div class="topiclist">
|
||||
<h1><span>{{ 'LATEST_ARTICLES'|t }}</span></h1>
|
||||
{% set tmplst = [] %}
|
||||
{% for page in my_collection %}
|
||||
{% set blisted = false %}
|
||||
@ -104,6 +105,9 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set articles = tmplst|slice(0,maxcount) %}
|
||||
{% if articles|length > 0 %}
|
||||
<h1><span>{{ 'LATEST_ARTICLES'|t }}</span></h1>
|
||||
{% include 'partials/topiclist.html.twig' with {'articles': articles, 'maxcount': maxcount} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user