You are here

bef-links.html.twig in Better Exposed Filters 8.4

Same filename and directory in other branches
  1. 8.5 templates/bef-links.html.twig
  2. 8.3 templates/bef-links.html.twig
{%
  set classes = [
    'bef-links',
    is_nested ? 'bef-nested'
  ]
%}
{% set is_nested = true %}
<div{{ attributes.addClass(classes) }}>
  {% set current_nesting_level = 0 %}
  {% for child in children %}
    {% set item = attribute(element, child) %}
    {% if child in selected %}
      {% set new_nesting_level = attribute(depth, child) %}
      {% set item = item|merge({'#attributes': {'class': 'bef-link-active'}}) %}
    {% endif %}
    {% set new_nesting_level = attribute(depth, child) %}
    {% include '@better_exposed_filters/bef-nested-elements.html.twig' %}
    {% set current_nesting_level = new_nesting_level %}
  {% endfor %}
</div>

File

templates/bef-links.html.twig
View source
  1. {%
  2. set classes = [
  3. 'bef-links',
  4. is_nested ? 'bef-nested'
  5. ]
  6. %}
  7. {% set is_nested = true %}
  8. <div{{ attributes.addClass(classes) }}>
  9. {% set current_nesting_level = 0 %}
  10. {% for child in children %}
  11. {% set item = attribute(element, child) %}
  12. {% if child in selected %}
  13. {% set new_nesting_level = attribute(depth, child) %}
  14. {% set item = item|merge({'#attributes': {'class': 'bef-link-active'}}) %}
  15. {% endif %}
  16. {% set new_nesting_level = attribute(depth, child) %}
  17. {% include '@better_exposed_filters/bef-nested-elements.html.twig' %}
  18. {% set current_nesting_level = new_nesting_level %}
  19. {% endfor %}
  20. </div>