Created
July 10, 2015 14:03
-
-
Save renebakx/9d7ea61854c05f68488a to your computer and use it in GitHub Desktop.
Splitting view rows in upcoming and recent on a date without creating a viewspluging
This file contains 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
{% for index,rawdata in view.result %} | |
{% set row_date = rawdata.field_field_conference_date[0]['raw']['value'] %} | |
{% set upcoming = false %} | |
{% set recent = false %} | |
{% if date(row_date) > date() %} | |
{% if not upcoming %} | |
<small>{{ 'Upcoming'|t }}</small> | |
{% set upcoming = true %} | |
{% endif %} | |
{% else %} | |
{% if not recent %} | |
<small>{{ 'Recent'|t }}</small> | |
{% set recent = true %} | |
{% endif %} | |
{% endif %} | |
{{ rows[index] }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment