uikit-view-grid.html.twig in UIkit Components 8
Same filename and directory in other branches
Theme override for views to display rows in a grid.
Available variables:
- 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.
- row_class_default: A flag indicating whether default classes should be used on rows.
- col_class_default: A flag indicating whether default classes should be used on columns.
- items: A list of grid items. Each item contains a list of rows or columns.
The order in what comes first (row or column) depends on which alignment
type is chosen (horizontal or vertical).
- attributes: HTML attributes for each row or column.
- content: A list of columns or rows. Each row or column contains:
- attributes: HTML attributes for each row or column.
- content: The row or column contents.
File
uikit_views/templates/views/uikit-view-grid.html.twigView source
- {#
- /**
- * @file
- * Theme override for views to display rows in a grid.
- *
- * Available variables:
- * - 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.
- * - row_class_default: A flag indicating whether default classes should be
- * used on rows.
- * - col_class_default: A flag indicating whether default classes should be
- * used on columns.
- * - items: A list of grid items. Each item contains a list of rows or columns.
- * The order in what comes first (row or column) depends on which alignment
- * type is chosen (horizontal or vertical).
- * - attributes: HTML attributes for each row or column.
- * - content: A list of columns or rows. Each row or column contains:
- * - attributes: HTML attributes for each row or column.
- * - content: The row or column contents.
- *
- * @see template_preprocess_views_view_grid()
- * @see template_preprocess_uikit_view_grid()
- */
- #}
- {{ attach_library('uikit_components/uikit-view-grid') }}
- {%
- set classes = [
- 'views-view-grid',
- 'uikit-view-grid',
- grid_divider ? 'uikit-view-grid-divider',
- ]
- %}
- {% if title %}
- <h3>{{ title }}</h3>
- {% endif %}
- <div id="{{ id }}" {{ attributes.addClass(classes) }}>
- <ul class="{{ grid_classes }}">
- {% for column in items %}
- {% for row in column.content %}
- <li>{{ row.content }}</li>
- {% endfor %}
- {% endfor %}
- </ul>
- </div>