Created
November 27, 2015 14:27
-
-
Save laurentsab/1a3a7871a12f5ec19bad to your computer and use it in GitHub Desktop.
Twig Loop modulo
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
<div class="row"> | |
<div class="col-md-9"> | |
<div class="row"> | |
{% if children is defined and children.pager.currentPageResults|length %} | |
{% for child in children.pager.currentPageResults %} | |
{% if loop.index0 % 2 == 0 and not loop.first %} | |
</div> | |
<div class="row"> | |
{% endif %} | |
<div class="col-xs-6"> | |
{% if loop.index0 % 2 == 0 %} | |
{{ render_esi( controller( 'ez_content:viewLocation', { 'locationId': child.id, 'viewType': 'bloc', "params": { "couleur": "bleu" } } ) ) }} | |
{% else %} | |
{{ render_esi( controller( 'ez_content:viewLocation', { 'locationId': child.id, 'viewType': 'bloc', "params": { "couleur": "orange" } } ) ) }} | |
{% endif %} | |
</div> | |
{% endfor %} | |
{% endif %} | |
</div> | |
</div> | |
<div class="col-md-3"> | |
<!-- Bloc --> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment