You are here

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

Theme override for views to display rows in a grid.

Available variables:

  • id: The unique id for the wrapping element.
  • attributes: HTML attributes for the wrapping element.
  • title: The title of this group of rows.
  • view: The view object.
  • rows: The rendered view results.
  • options: The view plugin style options.
    • grid_divider: A flag indicating whether default classes should be used on rows.
  • grid_attributes_: HTML attributes for the grid container element.
  • items: A list of grid items. Each item contains:
    • content: The columns's contents.

File

uikit_views/templates/views/uikit-view-grid.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for views to display rows in a grid.
  5. *
  6. * Available variables:
  7. * - id: The unique id for the wrapping element.
  8. * - attributes: HTML attributes for the wrapping element.
  9. * - title: The title of this group of rows.
  10. * - view: The view object.
  11. * - rows: The rendered view results.
  12. * - options: The view plugin style options.
  13. * - grid_divider: A flag indicating whether default classes should be
  14. * used on rows.
  15. * - grid_attributes_: HTML attributes for the grid container element.
  16. * - items: A list of grid items. Each item contains:
  17. * - content: The columns's contents.
  18. *
  19. * @see template_preprocess_uikit_view_grid()
  20. */
  21. #}
  22. {% if title %}
  23. <h3>{{ title }}</h3>
  24. {% endif %}
  25. <div id="{{ id }}" {{ attributes }}>
  26. <div{{ grid_attributes }}>
  27. {% for column in items %}
  28. <div>{{ column.content }}</div>
  29. {% endfor %}
  30. </div>
  31. </div>