{# /** * @file * Default theme implementation to output a views rows wrapper display style plugin. * * Available variables: * - rows: A list of the view's row items. * - attributes: The row's HTML attributes. * - content: The row's content. * - view: The view object. * - element_type: Wrapper element type * - attribute_type: Attribute type of the selected wrapper element * - attribute_name: Name of the selected attribute. * - rows_number: A number of rows to wrap * - wrap_method: 0 - Apply to all items, 1 - Wrap once. * - use_wrapper: A flag for wrapper usage * * @ingroup themeable */ #} {% if use_wrapper %}
{% set k = 0 %} {% set is_wrapped_once = 0 %} {% for row in rows %} {% set k = k + 1 %} {% if (k == 1) and (is_wrapped_once == 0) %} {% if attribute_name %} <{{ element_type }} {{ attribute_type }} ="{{ attribute_name }}"> {% else %} <{{ element_type }}> {% endif %} {{ row.content }}
{% else %} {{ row.content }} {% endif %} {% if (loop.index is divisible by(rows_number)) or ((loop.index == loop.last) and (k < rows_number)) %} {% if is_wrapped_once == 0 %} {% endif %} {% endif %} {% if (k == rows_number) %} {% set k = 0 %} {% if (wrap_method == 1) %} {% set is_wrapped_once = 1 %} {% endif %} {% endif %} {% endfor %} {% else %} {% for row in rows %} {{ row.content }} {% endfor %} {% endif %}