You are here

taxonomy-term--mie-demo-content.html.twig in Menu Item Extras 8.2

Theme override to display a taxonomy term.

Available variables:

  • url: URL of the current term.
  • name: Name of the current term.
  • content: Items for the content of the term (fields and description). Use 'content' to print them all, or print a subset such as 'content.description'. Use the following code to exclude the printing of a given child element:

  {{ content|without('description') }}
  
  • attributes: HTML attributes for the wrapper.
  • page: Flag for the full page state.
  • term: The taxonomy term entity, including:
    • id: The ID of the taxonomy term.
    • bundle: Machine name of the current vocabulary.
  • view_mode: View mode, e.g. 'full', 'teaser', etc.

File

modules/mie_demo_base/templates/taxonomy-term--mie-demo-content.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display a taxonomy term.
  5. *
  6. * Available variables:
  7. * - url: URL of the current term.
  8. * - name: Name of the current term.
  9. * - content: Items for the content of the term (fields and description).
  10. * Use 'content' to print them all, or print a subset such as
  11. * 'content.description'. Use the following code to exclude the
  12. * printing of a given child element:
  13. * @code
  14. * {{ content|without('description') }}
  15. * @endcode
  16. * - attributes: HTML attributes for the wrapper.
  17. * - page: Flag for the full page state.
  18. * - term: The taxonomy term entity, including:
  19. * - id: The ID of the taxonomy term.
  20. * - bundle: Machine name of the current vocabulary.
  21. * - view_mode: View mode, e.g. 'full', 'teaser', etc.
  22. *
  23. * @see template_preprocess_taxonomy_term()
  24. */
  25. #}
  26. {%
  27. set classes = [
  28. 'taxonomy-term',
  29. 'vocabulary-' ~ term.bundle|clean_class,
  30. ]
  31. %}
  32. <div{{ attributes.setAttribute('id', 'taxonomy-term-' ~ term.id).addClass(classes) }}>
  33. {{ title_prefix }}
  34. {{ title_suffix }}
  35. <a href="{{ url }}" class="taxonomy-link-wrapper">
  36. <div class="content">
  37. <h2>{{ name }}</h2>
  38. {{ content }}
  39. </div>
  40. </a>
  41. </div>