diff --git a/core/modules/views/templates/views-view-grid.html.twig b/core/modules/views/templates/views-view-grid.html.twig index 41113f8..f2b1552 100644 --- a/core/modules/views/templates/views-view-grid.html.twig +++ b/core/modules/views/templates/views-view-grid.html.twig @@ -34,63 +34,45 @@ 'clearfix', ] %} +{% if options.row_class_default %} + {% + set row_classes = [ + 'views-row', + options.alignment == 'horizontal' ? 'clearfix', + ] + %} +{% endif %} +{% if options.col_class_default %} + {% + set col_classes = [ + 'views-col', + options.alignment == 'vertical' ? 'clearfix', + ] + %} +{% endif %} {% if title %}

{{ title }}

{% endif %} -{% if options.alignment == 'horizontal' %} - {% for row in items %} - {% if options.row_class_default %} - {% - set row_classes = [ - 'views-row', - 'row-' ~ loop.index, - 'clearfix', - ] - %} - {% endif %} - - {% for column in row.content %} - {% if options.col_class_default %} - {% - set col_classes = [ - 'views-col', - 'col-' ~ loop.index, - ] - %} - {% endif %} - - {{ column.content }} - + {% if options.alignment == 'horizontal' %} + {% for row in items %} + + {% for column in row.content %} + + {{ column.content }} + + {% endfor %} + {% endfor %} - - {% endfor %} -{% else %} - {% for column in items %} - {% if options.col_class_default %} - {% - set col_classes = [ - 'views-col', - 'col-' ~ loop.index, - 'clearfix', - ] - %} - {% endif %} - - {% for row in column.content %} - {% if options.row_class_default %} - {% - set row_classes = [ - 'views-row', - 'row-' ~ loop.index, - ] - %} - {% endif %} - - {{ row.content }} - - {% endfor %} - - {% endfor %} -{% endif %} + {% else %} + {% for column in items %} + + {% for row in column.content %} + + {{ row.content }} + + {% endfor %} + + {% endfor %} + {% endif %}