{% extends 'Front/layout.html.twig' %}

{% set metatitle = maincontent.metatitle ? maincontent.metatitle : maincontent.menu %}
{% set metadescription = maincontent.metadescription ? maincontent.metadescription : null %}

{% set bodyClass = maincontent.menu.class %}

{% block body %}
    <div class="row">
        <article class="content list col">
            <div class="content-text">
                {{ maincontent.article|replace_custom_keys|raw }}
            </div>

            <div class="row list-cards cards-team">
                {% for content in contents %}
                    <div class="col-xl-3">
                        <article class="list-item card bg-theme">
                            <h3>{{ content.title }}</h3> 
                            <div class="item-footer">
                                <div class="figure" {% if content.picture is not empty %}style="background-image: url({{ asset(content.getWebPath()|imagine_filter('500L'))|replace({' ' : '%20'}) }});"{% endif %}></div>
                                <div class="text-center">
                                    <div class="item-desc">
                                        {{ content.article|raw }}
                                    </div>  
                                </div>
                            </div>
                        </article>
                    </div>
                {% endfor %}
            </div>
        </article>

        {% include "Front/_part/sidebar.html.twig" %}
    </div>
{% endblock %}

{% block before_body %} 
    {% set pageHeaderPicture = ( maincontent.picture ? asset(maincontent.getWebPath()) : null ) %}
    {% set pageHeaderTitle = maincontent.title %}
    {% set pageHeaderIntroduction = maincontent.introduction|replace_custom_keys|raw %}
    {% include "Front/_part/page-header.html.twig" %}
    {{ render(controller('AppBundle:Render:module', { position:'before_body' })) }}
{% endblock %}

{% block after_body %} 
    {{ render(controller('AppBundle:Render:module', { position:'after_body' })) }}
{% endblock %}