You are here

hierarchical-term-formatter.html.twig in Hierarchical Term Formatter 8

Default twig file for Hierarchical Term Formatter.

Available variables:

  • terms: The processed taxonomy terms to display.
  • wrapper: The HTML tag that should wrap each of the terms.
  • separator: The text used to separate each of the terms.

File

templates/hierarchical-term-formatter.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default twig file for Hierarchical Term Formatter.
  5. *
  6. * Available variables:
  7. * - terms: The processed taxonomy terms to display.
  8. * - wrapper: The HTML tag that should wrap each of the terms.
  9. * - separator: The text used to separate each of the terms.
  10. *
  11. * @see template_preprocess_hierarchical_term_formatter()
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. {% if wrapper == 'ol' or wrapper == 'ul' %}
  17. <{{ wrapper }} class="terms-hierarchy">
  18. {% endif %}
  19. {% for term in terms -%}
  20. {{ term }}{% if loop.last == false %}{{ separator }}{% endif %}
  21. {%- endfor %}
  22. {% if wrapper == 'ol' or wrapper == 'ul' %}
  23. </{{ wrapper }}>
  24. {% endif %}