You are here

uikit-view-list.html.twig in UIkit Components 8

Theme override for a view template to display a list of rows.

Available variables:

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

File

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