Newer
Older
{#
/**
* @file views-bootstrap-grid.html.twig
* Default simple view template to display Bootstrap Grids.
*
*
* - columns: Contains rows grouped by columns.
* - rows: Contains a nested array of rows. Each row contains an array of
* columns.
* - column_type: Contains a number (default Bootstrap grid system column type).
*
* @ingroup views_templates
*/
#}
{%
set classes = [
'views-view-grid',
options.alignment,
]
%}
{% if title %}
<h3>{{ title }}</h3>
{% endif %}
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<div id="{{ id }}" {{ attributes.addClass(classes) }}>
{% if options.alignment == 'horizontal' %}
{% for row in items %}
<div class="row">
{% for column in row.content %}
<div class="col {{ col_xs }} {{ col_sm }} {{ col_md }} {{ col_lg }} {{ options.row_class }}">
{{ column.content }}
</div>
{% endfor %}
</div>
{% endfor %}
{% else %}
<div class="row">
{% for column in items %}
<div class="col {{ col_xs }} {{ col_sm }} {{ col_md }} {{ col_lg }} {{ options.row_class }}">
{% for row in column.content %}
{{ row.content }}
{% endfor %}
</div>
{% if loop.index is divisible by (sizes.xs) %}
<div class="clearfix visible-xs-block"></div>
{% endif %}
{% if loop.index is divisible by (sizes.sm) %}
<div class="clearfix visible-sm-block"></div>
{% endif %}
{% if loop.index is divisible by (sizes.md) %}
<div class="clearfix visible-md-block"></div>
{% endif %}
{% if loop.index is divisible by (sizes.lg) %}
<div class="clearfix visible-lg-block"></div>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>