{# Construct a facet module populated with links to filtered results. name The field name identifying the facet field, eg. "tags" title The title of the facet, eg. "Tags", or "Tag Cloud" label_function Renders the human-readable label for each facet value. If defined, this should be a callable that accepts a `facet_item`. eg. lambda facet_item: facet_item.display_name.upper() By default it displays the facet item's display name, which should usually be good enough if_empty A string, which if defined, and the list of possible facet items is empty, is displayed in lieu of an empty list. count_label A callable which accepts an integer, and returns a string. This controls how a facet-item's count is displayed. extras Extra info passed into the add/remove params to make the url alternative_url URL to use when building the necessary URLs, instead of the default ones returned by url_for. Useful eg for dataset types. hide_empty Do not show facet if there are none, Default: false. search_facets Dictionary with search facets #} {% block facet_list %} {% set hide_empty = hide_empty or false %} {% with items = items or h.get_facet_items_dict(name, search_facets, exclude_active=true) %} {% if items or not hide_empty %} {% block facet_list_item %}
{% block facet_list_heading %} {% with items = items or h.get_facet_items_dict(name, search_facets) %} {% set active_facet = h.currently_active_facet(name) %} {% set collapsed = "collapsed" if default_collapsed and not active_facet else "" %}

{% endwith %} {% endblock %} {% block facet_list_items %} {% with items = items or h.get_facet_items_dict(name, search_facets) %} {% set active_facet = h.currently_active_facet(name) %} {% set collapse_show = "show" if active_facet or not default_collapsed else "collapse" %} {% if items %} {% else %}

{{ _('There are no {facet_type} that match this search').format(facet_type=title) }}

{% endif %} {% endwith %} {% endblock %}
{% endblock %} {% endif %} {% endwith %} {% endblock %}