123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- {% extends 'partials/base.html.twig' %}
- {% set bodyclass = "projet" %}
- {% set images = page.media.images[2:] %}
- {% set images = images|merge(page.media.files) %}
- {% block content %}
- <section class="projet">
- <h1>{{page.title}}</h1>
- <h2>{{ page.header.subtitle}}</h2>
- {{ page.content }}
- <div id="images" class="">
- {{ dump(images) }}
- {# set temporary array to be able to look trough images with index #}
- {% set numberedKeys = {} %}
- {% for key,value in images %}
- {% set numberedKeys = numberedKeys|merge({(loop.index):(key)}) %}
- {% endfor %}
- {{dump(numberedKeys)}}
- {# display images #}
- {% set continue = false %}
- {% for image in images %}
- {% if not continue %}
- <div class="row">
- {% if image.meta.size == 1 %}
- <div class="block block-{{loop.index}} column large-12">
- {{ image.html }}
- </div>
- {% else %}
- {% set nextimage = images[numberedKeys[loop.index]] %}
- {{ dump(nextimage) }}
- {% if nextimage.meta.size != 1 %}
- {% set continue = true %}
- <div class="block block-{{loop.index}} column large-6">
- {{ image.resize(1000).html }}
- </div>
- <div class="block block-{{loop.index+1}} column large-6">
- {{ nextimage.resize(1000).html }}
- </div>
- {% else %}
- <div class="block block-{{loop.index}} column large-6">
- {{ image.resize(1000).html }}
- </div>
- <div class="block empty column large-6"></div>
- {% endif %}
- {% endif %}
- </div>
- {% else %}
- {% set continue = false %}
- {% endif %}
- {% endfor %}
- </div>
- </section>
- <nav class="categories">
- {% include 'partials/tagslist.html.twig' with {'base_url':"/categories/", 'taxonomy':'tag', 'display':'inline'} %}
- </nav>
- {% endblock %}
|