{% extends 'partials/base.html.twig' %}
{% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}
{% set collection = page.collection() %}
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true)  %}
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}

{% block body %}

<div class="full">
  {% set options = { items: {'@page.self': '/projets'}, 'limit': 1 } %}
  {% set my_collection = page.collection(options) %}

    <div class="enter">
      {{content}}
    </div>

    {% for p in my_collection %}
      {% for image in p.media.images|randomize|slice(0,1) %}
        {{ image.html }}
      {% endfor %}
    {% endfor %}
</div>

{% endblock %}
