uikit-view-grid.html.twig in UIkit Components 8.2
Same filename and directory in other branches
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_classes: HTML classes for the grid container element.
- items: A list of grid items. Each item contains:
- content: The columns's contents.
See also
File
uikit_views/templates/views/uikit-view-grid.html.twigView source
- {#
- /**
- * @file
- * 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_classes: HTML classes for the grid container element.
- * - items: A list of grid items. Each item contains:
- * - content: The columns's contents.
- *
- * @see template_preprocess_uikit_view_grid()
- */
- #}
- {{ attach_library('uikit_views/uikit-view-grid') }}
- {%
- set classes = [
- 'views-view-grid',
- 'uikit-view-grid',
- options.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 %}
- <li>{{ column.content }}</li>
- {% endfor %}
- </ul>
- </div>