Created
March 1, 2016 19:08
-
-
Save deviantintegral/9cc04b6a95082673b540 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
/** | |
* @file | |
* Default theme implementation to display a view of unformatted rows. | |
* | |
* Available variables: | |
* - title: The title of this group of rows. May be empty. | |
* - rows: A list of the view's row items. | |
* - attributes: The row's HTML attributes. | |
* - content: The row's content. | |
* - view: The view object. | |
* - default_row_class: A flag indicating whether default classes should be | |
* used on rows. | |
* | |
* @see template_preprocess_views_view_unformatted() | |
* | |
* @ingroup themeable | |
*/ | |
#} | |
{% if title %} | |
<h3>{{ title }}</h3> | |
{% endif %} | |
{% set even_rows = "" %} | |
{% set odd_rows = "" %} | |
{% for row in rows %} | |
{% | |
set row_classes = [ | |
default_row_class ? 'views-row', | |
] | |
%} | |
{% set row %} | |
<div{{ row.attributes.addClass(row_classes) }}> | |
{{ row.content }} | |
</div> | |
{% endset %} | |
{% if loop.index is divisible by (2) %} | |
{% set even_rows = even_rows ~ row %} | |
{% else %} | |
{% set odd_rows = odd_rows ~ row %} | |
{% endif %} | |
{% endfor %} | |
<div class="this-is-the-main-div"> | |
<div class="odd-rows"> | |
{{ odd_rows|raw }} | |
</div> | |
<div class="even-rows"> | |
{{ even_rows|raw }} | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment