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 0a1d1a6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions templates/search.twig
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div id="item-modal-issue" class="collapse show" role="tabpanel">
<ul class="list-unstyled">
{% for category in categories %}
{% if ( category.results >= 0 ) %}
{% if ( category.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand Down Expand Up @@ -113,7 +113,7 @@
<div id="item-modal-category" class="collapse show" role="tabpanel">
<ul class="list-unstyled">
{% for page_type in page_types %}
{% if ( page_type.results >= 0 ) %}
{% if ( page_type.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand Down Expand Up @@ -142,7 +142,7 @@
<div id="item-modal-content" class="collapse show" role="tabpanel">
<ul class="list-unstyled">
{% for id, content_type in content_types %}
{% if ( content_type.results >= 0 ) %}
{% if ( content_type.results > 0 ) %}
<li>
<label class="custom-control">
<input
Expand Down Expand Up @@ -174,6 +174,7 @@
<div id="item-modal-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 @@ -188,6 +189,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 @@ -228,6 +230,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 +245,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 +259,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 +273,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 +314,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 +329,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 0a1d1a6

Please sign in to comment.