{% extends 'partials/base.html.twig' %} {% set bodyclass = "projet" %} {% set images = page.media.images[2:] %} {% set images = images|merge(page.media.files) %} {% block content %}

{{page.title}}

{{ page.header.subtitle}}

{{ page.content }}
{{ 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 %}
{% if image.meta.size == 1 %}
{{ image.html }}
{% else %} {% set nextimage = images[numberedKeys[loop.index]] %} {{ dump(nextimage) }} {% if nextimage.meta.size != 1 %} {% set continue = true %}
{{ image.resize(1000).html }}
{{ nextimage.resize(1000).html }}
{% else %}
{{ image.resize(1000).html }}
{% endif %} {% endif %}
{% else %} {% set continue = false %} {% endif %} {% endfor %}
{% endblock %}