uikit-view-accordion.html.twig in UIkit Components 8.2
Same filename and directory in other branches
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.
- accordion_toggle: The class to use as the accordion toggle.
- accordion_container: The class to use as the accordion content container.
See also
File
uikit_views/templates/views/uikit-view-accordion.html.twigView source
- {#
- /**
- * @file
- * 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.
- * - accordion_toggle: The class to use as the accordion toggle.
- * - accordion_container: The class to use as the accordion content container.
- *
- * @see template_preprocess_uikit_view_accordion()
- */
- #}
- {{ attach_library('uikit/uikit.accordion') }}
- {% if title %}
- <h3>{{ title }}</h3>
- {% endif %}
-
- <div{{ accordion_attributes }}>
- {% for row in items %}
- <h3 class="{{ accordion_toggle }}">{{ row.title }}</h3>
- <div class="{{ accordion_container }}">{{ row.content }}</div>
- {% endfor %}
- </div>