{% extends default_layout is defined ? default_layout : "AyalineEzMiniSitesCollectivitesBundle::pagelayout.html.twig" %}
{% block file_ariane %}
{% endblock %}
 {% block content %}
     <h1>
         {% if content.fields.meta_title is defined and not ez_is_field_empty( content, 'meta_title' ) %}
             {{ ez_render_field(content, 'meta_title') }}
         {% else %}
             {{ ez_content_name( content ) }}
         {% endif %}
     </h1>
     {% block presentation %}
         {% if content.fields.texte_presentation is defined and not ez_is_field_empty(content, "texte_presentation") %}
             <div class="bloc-type">
                 <div class="container">
                     {{ ez_render_field(content, 'texte_presentation') }}
                 </div>
             </div>
         {% endif %}
     {% endblock %}

     {# Bloc Actualités #}
     {% if configurationGenerale.fields.afficher_actualite is defined and not ez_is_field_empty( configurationGenerale, 'afficher_actualite' ) %}
         {% block actualites_home %}
             <div id="bloc-actualites-2" class="bloc-actualites-2 bloc-actualites-2-v2">
                 <div class="container">
                     <div class="row">

                         {{ render( controller(
                         "AyalineEzActualitesCollectivitesBundle:NewsRoot:embedNews",
                         {
                             'rootID' : content.contentInfo.mainLocationId,
                             'template': 'AyalineEzMiniSitesCollectivitesBundle::home/actualites_mini_site.html.twig',
                             'limit': 4,
                             'racine_actualite_id': location_id_by_content_id(configurationGenerale.getField('actualites_racine').value.destinationContentId)
                         }
                         )
                         ) }}
                     </div>
                 </div>
             </div>
         {% endblock %}
     {% endif %}
     {# Fin bloc Actualités #}

     {% block grille %}
         {{ render(controller("AyalineEzMiniSitesCollectivitesBundle:Home:getBlocHome", {'type': 'bloc_accueil_mini_sites_racine', 'template': 'AyalineEzMiniSitesCollectivitesBundle:home:bloc_home.html.twig'})) }}
     {% endblock %}

     {% if configurationGenerale.fields.afficher_rs_newsletter is defined and not ez_is_field_empty( configurationGenerale, 'afficher_rs_newsletter' ) %}
         <div class="bloc-contact">
             <div class="container">
                 {% block reseaux_sociaux %}
                     <div class="bloc-rs-footer col-md-6">
                         <h2 class="h2-home-theme">Suivez-nous</h2>
                         {{ render (controller("AyalineCollectiviteBundle:PageLayout:getSocialNetworks")) }}
                     </div>
                 {% endblock %}
                 {% block contact %}
                     <div class="bloc-newsletter col-md-6">
                         {% if content.fields.formulaire_contact is defined and not ez_is_field_empty(content, "formulaire_contact") %}
                             <a href="{{ path( 'ez_urlalias', {'locationId': location_id_by_content_id(content.getField('formulaire_contact').value.destinationContentId)  } ) }}" class="contact-link h3-theme-2">Contactez-nous</a>
                         {% endif %}

                         {% if configurationGenerale is defined and configurationGenerale.fields.newsletter_lettres is defined and not ez_is_field_empty( configurationGenerale, "newsletter_lettres" ) %}
                             <h3 class="h3-theme-2">Lettre d'information</h3>

                             <div class="newsletter-form">
                                 {{ render (controller("AyalineCollectiviteBundle:PageLayout:newsletter")) }}
                             </div>
                         {% endif %}
                     </div>
                 {% endblock %}
             </div>
         </div>
     {% endif %}

 {% endblock content %}