templates/front/front_news/index.html.twig line 1

Open in your IDE?
  1. {% extends 'layouts/layouts_front/base_front.html.twig' %}
  2. {% set cmptBack = 0 %}
  3. {% block stylesheets %}
  4.     <link rel="stylesheet preload" as="style" media="screen" href="{{ asset('css/actualite.css') }}">
  5. {% endblock %}
  6. {% set titleAff = page.seoTitle|default(page.ptitreonglet)|default(page.ptitre) %}
  7. {% if catEnCours is defined %}
  8.     {% for cat in  categories %}
  9.         {% if cat.id == catEnCours %}
  10.             {% set titleAff = titleAff~" - "~cat.actCatIntitule %}
  11.         {% endif %}
  12.     {% endfor %}
  13. {% endif %}
  14. {% set titleAff = titleAff|slice(0,34)~" | "~nomDuSite %}
  15. {% if app.request.locale == 'fr' %}
  16.     {% set metaDescr = page.seoDescription|default( "Retrouvez toutes les actualités sur le site de "~nomDuSite) %}
  17. {% else %}
  18.     {% set metaDescr = page.seoDescription|default("Find all the news on the "~nomDuSite~" website") %}
  19. {% endif %}
  20. {% if catEnCours is defined %}
  21.     {% for cat in  categories %}
  22.         {% if cat.id == catEnCours %}
  23.             {% if app.request.locale == 'fr' %}
  24.                 {% set metaDescr = "Retrouvez toutes les actualités de la catégorie "~cat.actCatIntitule~" sur le site de "~nomDuSite %}
  25.             {% else %}
  26.                 {% set metaDescr = "Find all the news of the "~cat.actCatIntitule~" category on the "~nomDuSite~" website" %}
  27.             {% endif %}
  28.         {% endif %}
  29.     {% endfor %}
  30. {% endif %}
  31. {% block metaDescription %}{{ metaDescr }}{% endblock %}
  32. {% block metaDescriptionOg %}{{ metaDescr }}{% endblock %}
  33. {% block keywords %}{{ page.seoKeywords }}{% endblock %}
  34. {% block title %}{{ titleAff }}{% endblock %}
  35. {% block titleOg %}{{ titleAff }}{% endblock %}
  36. {% block content %}
  37.     {% if page is not null %}
  38.         {{ include('front/front_news/header.html.twig') }}
  39.         {{ include('front/front_news/nav_ariane.html.twig') }}
  40.     {% endif %}
  41.     <div id="page_module">
  42.         <div class="container">
  43.             <div class="row justify-content-center">
  44.                 <div class="col-md-12 respfrontcata">
  45.                     <div class="noFadeInUp d-flex justify-content-center flex-column align-items-center navproduct mt-5">
  46.                         <div class="respmobile">
  47.                             <a class="noFadeInUp btn btn-primary touteActus{% if actEnCours is defined and actEnCours == 0 %} active{% endif %}"
  48.                                href="{{ websiteroot }}/actualite">
  49.                                 <span>Toutes les actualites</span>
  50.                             </a>
  51.                             {% for categ in categories %}
  52.                                 {% if categ.nbActus > 0 %}
  53.                                     {% set numCouleur = 1 %}
  54.                                     {% set isSelected = 0 %}
  55.                                     {% if categ.id == actEnCours %}
  56.                                         {% set isSelected = 1 %}
  57.                                     {% endif %}
  58.                                     <a class="noFadeInUp btn btn-primary touteActus{% if isSelected == 1 %} active{% elseif actEnCours != null %} noSelected{% endif %}"
  59.                                        href="/actualite/{{ categ.actCatIntitule }}/{{ categ.id }}"
  60.                                        data-type="{{ categ.id }}"
  61.                                        value="{{ categ.actCatIntitule }}">
  62.                                         <span>{{ categ.actCatIntitule }}</span>
  63.                                     </a>
  64.                                 {% endif %}
  65.                             {% endfor %}
  66.                             </select>
  67.                         </div>
  68.                     </div>
  69.                 </div>
  70.             </div>
  71.         </div>
  72.         {% if actualites|length >0 %}
  73.             <section data-bs-version="5.1" class="mbr-embla cid-sZogb0MkOH">
  74.                 <div class="position-relative">
  75.                     {#                    <div class="mbr-section-head"> #}
  76.                     {#                        <h4 class="mbr-section-title mbr-fonts-style align-center mb-0 display-2"> #}
  77.                     {#                            <strong>Actualit&eacute;</strong></h4> #}
  78.                     {#                        <h5 class="mbr-section-subtitle mbr-fonts-style align-center mb-0 mt-2 display-5"> #}
  79.                     {#                            Sous titre actualit&eacute; #}
  80.                     {#                        </h5> #}
  81.                     {#                    </div> #}
  82.                     <div class="d-flex flex-column">
  83.                         <div class="d-flex flex-row flex-md-wrap blockActusTotal">
  84.                             {% for event in actualites %}
  85.                                 {% set mediaTmp = event.media_fichier %}
  86.                                 {% set mediaDefault = "default.jpg" %}
  87.                                 {% set mediaTmp = webp(webpSupported, mediaTmp) %}
  88.                                 {% set mediaDefault = webp(webpSupported, mediaDefault) %}
  89.                                 <div class="item blockActusIndex">
  90.                                     <div class="item-wrapper imageRondIndexActus">
  91.                                         <div class="h-100">
  92.                                             <a href="{{ path('front_news_card', {id:event.id}) }}">
  93.                                                 <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
  94.                                                      alt="{{ event.act_titre|default(nomDuSite) }}"
  95.                                                      title="{{ event.act_titre|default(nomDuSite) }}"
  96.                                                      loading="lazy"
  97.                                                      class="lazyload imgHeight"
  98.                                                      data-src="{{ asset('/medias_front/actualite/'~mediaTmp|default(mediaDefault)) }}"
  99.                                                      itemprop="image">
  100.                                             </a>
  101.                                         </div>
  102.                                     </div>
  103.                                     <div class="item-content">
  104.                                         <a href="{{ path('front_news_card', {id:event.id}) }}">
  105.                                             <h6 class="item-subtitle mbr-fonts-style mt-1 display-7">
  106.                                                 <strong>{{ event.act_titre }}</strong>
  107.                                             </h6>
  108.                                             <h5 class="item-title mbr-fonts-style display-4 dateActus">
  109.                                                 <time itemprop="startDate"
  110.                                                       datetime="{{ event.act_date_publication|date('Y-m-d') }}">
  111.                                                     {{ event.act_date_publication|date("d/m/Y") }}
  112.                                                 </time>
  113.                                             </h5>
  114.                                         </a>
  115.                                     </div>
  116.                                 </div>
  117.                             {% endfor %}
  118.                         </div>
  119.                         {{ knp_pagination_render(actualites, 'layouts/layouts_front/pagination/paginate.html.twig') }}
  120.                     </div>
  121.                 </div>
  122.             </section>
  123.         {% endif %}
  124.     </div>
  125. {% endblock %}
  126. {% block javascripts %}
  127. {% endblock %}