You are here

views-layout-style.html.twig in Views Layout 8

Template for the Views layout style.

File

templates/views-layout-style.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for the Views layout style.
  5. */
  6. * Available variables:
  7. * - attributes: HTML attributes for the wrapping element.
  8. * - title: The title of this group of rows.
  9. * - view: The view object.
  10. * - rows: The rendered view results. Each row contains a single instance
  11. * of the layout, populated with views results. For instance, if the
  12. * layout has three populated regions, the row will be a grid that
  13. * contains three of the result rows, rendered into that layout.
  14. * - options: The view plugin style options.
  15. * - layout_name: Name of the layout being rendered.
  16. * - layout_regions: Comma-separated list of regions to populate.
  17. * - default_row_class: A flag indicating whether default classes should be
  18. *
  19. * @see template_preprocess_views_layout_style()
  20. *
  21. * @ingroup themeable
  22. */
  23. #}
  24. {% if title %}
  25. <h3>{{ title }}</h3>
  26. {% endif %}
  27. {% for row in rows %}
  28. {%
  29. set row_classes = [
  30. default_row_class ? 'views-row',
  31. 'views-layout',
  32. options.layout_name,
  33. ]
  34. %}
  35. <div{{ row.attributes.addClass(row_classes) }}>
  36. {{- row.content -}}
  37. </div>
  38. {% endfor %}