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.
1 theme call to hierarchical-term-formatter.html.twig
- HierarchicalFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ HierarchicalFormatter.php - Builds a renderable array for a field value.
File
templates/hierarchical-term-formatter.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @see template_preprocess_hierarchical_term_formatter()
- *
- * @ingroup themeable
- */
- #}
- {% if wrapper == 'ol' or wrapper == 'ul' %}
- <{{ wrapper }} class="terms-hierarchy">
- {% endif %}
- {% for term in terms -%}
- {{ term }}{% if loop.last == false %}{{ separator }}{% endif %}
- {%- endfor %}
- {% if wrapper == 'ol' or wrapper == 'ul' %}
- </{{ wrapper }}>
- {% endif %}