Skip to content

Commit

Permalink
PLANET-6552: Hide taxonomies with no content
Browse files Browse the repository at this point in the history
Hide filters with 0 results
  • Loading branch information
lithrel committed Apr 27, 2022
1 parent f19a38c commit 8d38edc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/search.twig
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
<div id="item-issue" class="collapse show" role="tabpanel">
<ul class="list-unstyled">
{% for category in categories %}
{% if ( category.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand All @@ -242,6 +243,7 @@
<span class="custom-control-description">{{ category.name|e('wp_kses_post')|raw }} ({{ category.results }})</span>
</label>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand All @@ -255,6 +257,7 @@
<div id="item-campaign" class="collapse {{ show }}" role="tabpanel">
<ul class="list-unstyled">
{% for tag in tags %}
{% if ( tag.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand All @@ -268,6 +271,7 @@
<span class="custom-control-description">{{ tag.name|e('wp_kses_post')|raw }} ({{ tag.results }})</span>
</label>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand Down Expand Up @@ -308,6 +312,7 @@
<div id="item-content" class="collapse {{ show }}" role="tabpanel">
<ul class="list-unstyled">
{% for id, content_type in content_types %}
{% if ( content_type.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand All @@ -322,6 +327,7 @@
<span class="custom-control-description">{{ content_type.name }} ({{ content_type.results }})</span>
</label>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit 8d38edc

Please sign in to comment.