xbase-2.x-dev/templates/overridden/views-view-list.html.twig
templates/overridden/views-view-list.html.twig
{#
/**
* @file
* Default theme implementation 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: @todo.
* - type: Starting tag will be either a ul or ol.
* - attributes: HTML attributes for the list element.
*
* @see template_preprocess_views_view_list()
*
* @ingroup themeable
*/
#}
{% set list_attributes = list.attributes ? list.attributes : create_attribute() %}
{% if title %}
{% set attributes = attributes ? attributes : create_attribute() %}
{% set attributes = attributes.addClass(html_class ~ '__group') %}
{% set list_attributes = list_attributes.addClass(html_class ~ '__group-content') %}
{% endif %}
{% if attributes or title -%}
<div{{ attributes }}>
{% endif %}
{% if title %}
<div class="{{ html_class }}__group-title">{{ title }}</div>
{% endif %}
<{{ list.type }}{{ list_attributes }}>
{% for row in rows %}
<li{{ row.attributes }}>
{{- row.content -}}
</li>
{% endfor %}
</{{ list.type }}>
{% if attributes or title -%}
</div>
{% endif %}
