do not show filter headline if there are none
authorChristian Weiske <cweiske@cweiske.de>
Thu, 4 Feb 2016 16:23:14 +0000 (17:23 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 4 Feb 2016 16:23:14 +0000 (17:23 +0100)
data/templates/search/sidebar.htm

index 8665706581a3c594dc72250c25634aacd214f11e..9e36312c11480b9c92bf0bece00ec4e228165955 100644 (file)
@@ -1,10 +1,15 @@
-<p>
- Filter results by:
-</p>
-{% include 'search/sidebar-filter.htm' with {'type': 'tags', 'title': 'Tag'} %}
-{% include 'search/sidebar-filter.htm' with {'type': 'domain', 'title': 'Domain'} %}
-{% include 'search/sidebar-filter.htm' with {'type': 'language', 'title': 'Language'} %}
-{% include 'search/sidebar-filter.htm' with {'type': 'type', 'title': 'Type'} %}
+{% set filters %}
+ {% include 'search/sidebar-filter.htm' with {'type': 'tags', 'title': 'Tag'} %}
+ {% include 'search/sidebar-filter.htm' with {'type': 'domain', 'title': 'Domain'} %}
+ {% include 'search/sidebar-filter.htm' with {'type': 'language', 'title': 'Language'} %}
+ {% include 'search/sidebar-filter.htm' with {'type': 'type', 'title': 'Type'} %}
+{% endset %}
+{% if filters|trim %}
+ <p>
+  Filter results by:
+ </p>
+ {{filters}}
+{% endif %}
 
 <p class="muted">
  Query took {{queryTime}}.