Override Octavia views template for pages

This commit is contained in:
benjamin melançon 2018-12-10 16:56:02 -05:00
parent 97e4e6f56b
commit 9eeb560de4

View file

@ -0,0 +1,19 @@
{% extends "@stable/views/views-view.html.twig" %}
{% set style = view.getStyle().getPluginId() %}
{% set default_row_class = view.style_plugin.options.default_row_class %}
{% set has_view_mode = view.rowPlugin.options['view_mode'] is defined or view.rowPlugin.options['view_modes'] is defined %}
{#
Only apply to unformatted (default) displays without a row class and with a
selected view mode.
#}
{% if (style == 'default') and (not default_row_class) and has_view_mode %}
{# Add columns classes to the wrapper. #}
{%
set classes = [
'columns',
'is-multiline',
'is-centered'
]
%}
{% set attributes = attributes.addClass(classes) %}
{% endif %}