You are here

uikit-view-accordion.html.twig in UIkit Components 8.3

Same filename and directory in other branches
  1. 8.2 uikit_views/templates/views/uikit-view-accordion.html.twig

Theme override for a view template to display an accordion of rows.

Available variables:

  • accordion_attributes: HTML attributes for the container.
  • items: A list of rows for this accordion.
    • title: The row's title.
    • content: The row's contents.
  • title: The title of this group of rows. May be empty.

File

uikit_views/templates/views/uikit-view-accordion.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for a view template to display an accordion of rows.
  5. *
  6. * Available variables:
  7. * - accordion_attributes: HTML attributes for the container.
  8. * - items: A list of rows for this accordion.
  9. * - title: The row's title.
  10. * - content: The row's contents.
  11. * - title: The title of this group of rows. May be empty.
  12. *
  13. * @see template_preprocess_uikit_view_accordion()
  14. */
  15. #}
  16. {% if title %}
  17. <h3>{{ title }}</h3>
  18. {% endif %}
  19. <ul{{ accordion_attributes }}>
  20. {% for row in items %}
  21. <li>
  22. <h3 class="uk-accordion-title">{{ row.title }}</h3>
  23. <div class="uk-accordion-content">{{ row.content }}</div>
  24. </li>
  25. {% endfor %}
  26. </ul>