templates/front_v4/mca/blog/list.html.twig line 1

Open in your IDE?
  1. {% extends 'front_v4/base.html.twig' %}
  2. {% block meta_title %}Mon Centre Auditif - Découvrez notre blog {% if pagination is defined and pagination is not null and pagination.params is not empty %} | Page {{ pagination.currentPageNumber }} {% endif %}{% endblock meta_title %}
  3. {% block meta_description %}Retrouvez toutes nos publications relatives à l'audition pour vous informer sur l'univers de l'aide auditive{% endblock meta_description %}
  4. {% block meta_custom %}
  5.     {% if pagination is defined and pagination is not null %}
  6.         {% set numberOfPage = pagination.totalItemCount / pagination.itemNumberPerPage %}
  7.         {% if numberOfPage > 1 %}
  8.             {% set next = pagination.currentPageNumber+1 %}
  9.             {% set prev = pagination.currentPageNumber-1 %}
  10.             {% if pagination.currentPageNumber == 1 %}
  11.                 {% set next = pagination.currentPageNumber+1 %}
  12.                 <link rel="next" href="{{ path(app.request.attributes.get('_route'),
  13.                     app.request.attributes.get('_route_params')) ~ "?page=" ~ next }}"/>
  14.             {% elseif pagination.currentPageNumber == numberOfPage %}
  15.                 <link rel="prev" href="{{ path(app.request.attributes.get('_route'),
  16.                     app.request.attributes.get('_route_params')) ~ "?page=" ~ prev }}"/>
  17.             {% else %}
  18.                 <link rel="next" href="{{ path(app.request.attributes.get('_route'),
  19.                     app.request.attributes.get('_route_params')) ~ "?page=" ~ next }}"/>
  20.                 <link rel="prev" href="{{ path(app.request.attributes.get('_route'),
  21.                     app.request.attributes.get('_route_params')) ~ "?page=" ~ prev }}"/>
  22.             {% endif %}
  23.         {% endif %}
  24.     {% endif %}
  25. {% endblock meta_custom %}
  26. {% block stylesheets %}
  27.     {{ encore_entry_link_tags('blog_list') }}
  28. {% endblock stylesheets %}
  29. {% block content %}
  30.     <div id="header"></div>
  31.     <!-- ========== MAIN CONTENT ========== -->
  32.     <main id="content" role="main">
  33.         <!-- Blog Carousel -->
  34.         {% include 'front_v4/mca/blog/_blog_swiper.html.twig' %}
  35.         <!-- End Blog Carousel -->
  36.         <!-- Card Grid -->
  37.         <div class="container content-space-2">
  38.             <!-- Hero -->
  39.             <div class="content-space-b-1">
  40.                 <div class="w-md-75 text-center mx-md-auto">
  41.                     <h1 class="">Le blog de l'audition</h1>
  42.                     <p class="lead">Découvrez les dernières actualités sur l'univers de l'audition.</p>
  43.                 </div>
  44.             </div>
  45.             <!-- End Hero -->
  46.             <div class="row justify-content-lg-between">
  47.                 <div class="col-lg-8 mb-10 mb-lg-0">
  48.                     <div class="d-grid gap-7 mb-7">
  49.                         {% for post in pagination %}
  50.                             <a href="{{ path('blog_post_show', {'slug': post.slug}) }}">
  51.                                 {% if post.isPillarPage == true %}
  52.                                     <div class="card card-transition align-items-start flex-wrap flex-row bg-img-start gradient-overlay-half-dark-v2"
  53.                                          style="background-image: url('{% if post.filename %} {{ vich_uploader_asset(post, 'imageFile') | imagine_filter('blog_post_extra_large') }} {% endif %}'); min-height: 25rem;">
  54.                                         <!-- Card Header -->
  55.                                         <div class="card-header w-100">
  56.                                             <div class="d-flex align-items-center">
  57.                                                 <div class="flex-shrink-0">
  58.                         <span class="avatar avatar-sm avatar-circle">
  59.                           <img class="avatar-img"
  60.                                src="{% if post.blogAuthor.filename %} {{ vich_uploader_asset(post.blogAuthor, 'imageFile') | imagine_filter('author_image_small') }} {% endif %}"
  61.                                alt="{{ post.blogAuthor.firstname }}">
  62.                         </span>
  63.                                                 </div>
  64.                                                 <div class="flex-grow-1 ms-3">
  65.                                                     <h4 class="card-title text-white mb-0">{{ post.blogAuthor.firstname }}</h4>
  66.                                                     <p class="card-text text-white-70 small">{{ post.createdAt|format_date('medium') }}</p>
  67.                                                 </div>
  68.                                             </div>
  69.                                         </div>
  70.                                         <!-- End Card Header -->
  71.                                         <!-- Card Footer -->
  72.                                         <div class="card-footer mt-auto">
  73.                                             <h3 class="h2 text-white">{{ post.title }}</h3>
  74.                                             <p class="text-white-70">{{ post.body|striptags|truncate(120, true)|raw|nl2br }}</p>
  75.                                         </div>
  76.                                         <!-- End Card Footer -->
  77.                                     </div>
  78.                                 {% else %}
  79.                                     <!-- Card -->
  80.                                     <div class="card card-flush card-stretched-vertical">
  81.                                         <div class="row">
  82.                                             <div class="col-sm-5">
  83.                                                 {# img size : 400x500 #}
  84.                                                 <img class="card-img"
  85.                                                      src="{% if post.filename %} {{ vich_uploader_asset(post, 'imageFile') | imagine_filter('blog_post_small') }} {% endif %}"
  86.                                                      alt="{{ post.title }}">
  87.                                             </div>
  88.                                             <!-- End Col -->
  89.                                             <div class="col-sm-7">
  90.                                                 <!-- Card Body -->
  91.                                                 <div class="card-body">
  92.                                                     <div class="mb-2">
  93.                                                         <h5 class="text-primary">{{ post.blogCategory }}</h5>
  94.                                                     </div>
  95.                                                     <h3 class="card-title text-dark">{{ post.title }}</h3>
  96.                                                     <p class="card-text">{{ post.body|striptags|truncate(250, true)|raw|nl2br }}</p>
  97.                                                     <!-- Card Footer -->
  98.                                                     <div class="card-footer">
  99.                                                         <div class="d-flex">
  100.                                                             <div class="flex-shrink-0">
  101.                                                                 <h4 class="avatar avatar-circle">
  102.                                                                     <img class="avatar-img"
  103.                                                                          src="{% if post.blogAuthor.filename %} {{ vich_uploader_asset(post.blogAuthor, 'imageFile') | imagine_filter('author_image_small') }} {% endif %}"
  104.                                                                          alt="{{ post.blogAuthor.firstname }}">
  105.                                                                 </h4>
  106.                                                             </div>
  107.                                                             <div class="flex-grow-1 ms-3">
  108.                                                                 <h4 class="mb-0">{{ post.blogAuthor.firstname }}</h4>
  109.                                                                 <p class="card-text small">{{ post.createdAt|format_date('medium') }}</p>
  110.                                                             </div>
  111.                                                         </div>
  112.                                                     </div>
  113.                                                     <!-- End Card Footer -->
  114.                                                 </div>
  115.                                                 <!-- End Card Body -->
  116.                                             </div>
  117.                                             <!-- End Col -->
  118.                                         </div>
  119.                                         <!-- End Row -->
  120.                                     </div>
  121.                                     <!-- End Card -->
  122.                                 {% endif %}
  123.                             </a>
  124.                         {% else %}
  125.                             <p class="h5 fw-bold mx-3">Aucun article trouvé</p>
  126.                         {% endfor %}
  127.                     </div>
  128.                     <!-- Sticky Block End Point -->
  129.                     <div id="stickyBlockEndPoint"></div>
  130.                     <!-- Pagination -->
  131.                     {% if pagination is defined and pagination is not null %}
  132.                         <div class="navigation pagination d-flex justify-content-center mt-5">
  133.                             {% do pagination.setTemplate('@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig') %}
  134.                             {{ knp_pagination_render(pagination) }}
  135.                         </div>
  136.                     {% endif %}
  137.                     <!-- End Pagination -->
  138.                 </div>
  139.                 <!-- End Col -->
  140.                 <div class="col-lg-3">
  141.                     <div class="mb-7">
  142.                         <div class="mb-3">
  143.                             <h3>Rechercher un article</h3>
  144.                         </div>
  145.                         <!-- Search -->
  146.                         {{ form_start(form) }}
  147.                         <div class="input-group">
  148.                             {{ form_widget(form.keyword) }}
  149.                             <div class="input-group-append">
  150.                                 {{ form_widget(form.submit) }}
  151.                             </div>
  152.                         </div>
  153.                         {{ form_end(form) }}
  154.                         <!-- End Search -->
  155.                         <p class="form-text">Saisissez un mot-clé pour effectuer une recherche parmi tous nos
  156.                             articles.</p>
  157.                     </div>
  158.                     <!-- Sticky Block Start Point -->
  159.                     <div id="stickyBlockStartPoint"></div>
  160.                     <div class="js-sticky-block"
  161.                          data-hs-sticky-block-options='{
  162.                  "parentSelector": "#stickyBlockStartPoint",
  163.                  "targetSelector": "#header",
  164.                  "breakpoint": "md",
  165.                  "startPoint": "#stickyBlockStartPoint",
  166.                  "endPoint": "#stickyBlockEndPoint",
  167.                  "stickyOffsetTop": 80
  168.                }'>
  169.                         {% if randomPageByCategory is defined and randomPageByCategory is not empty %}
  170.                             <div class="mb-7">
  171.                                 <div class="mb-3">
  172.                                     <h3>Notre sélection</h3>
  173.                                 </div>
  174.                                 <div class="d-grid gap-2">
  175.                                     {% for post in randomPageByCategory %}
  176.                                         <!-- Card -->
  177.                                         <a class="d-block" href="{{ path('blog_post_show', {'slug': post.slug}) }}">
  178.                                             <div class="d-flex align-items-center">
  179.                                                 <div class="flex-shrink-0">
  180.                                                     <div class="avatar avatar-lg">
  181.                                                         <img class="avatar-img"
  182.                                                              src="{% if post.filename %} {{ vich_uploader_asset(post, 'imageFile') | imagine_filter('blog_post_small') }} {% endif %}"
  183.                                                              alt="{{ post.title }}">
  184.                                                     </div>
  185.                                                 </div>
  186.                                                 <div class="flex-grow-1 ms-3">
  187.                                                     <h5 class="text-inherit mb-0">{{ post.title }}</h5>
  188.                                                 </div>
  189.                                             </div>
  190.                                         </a>
  191.                                         <!-- End Card -->
  192.                                     {% endfor %}
  193.                                 </div>
  194.                             </div>
  195.                         {% endif %}
  196.                         {% if featuredCategory is defined and featuredCategory is not empty %}
  197.                         <div class="mb-7">
  198.                             <div class="mb-3">
  199.                                 <h3>{{ featuredCategory.name }}</h3>
  200.                             </div>
  201.                             <!-- List Group -->
  202.                             <ul class="list-group list-group-lg">
  203.                                 {% for post in featuredLastedPostByCategory %}
  204.                                     <!-- Item -->
  205.                                     <li class="list-group-item">
  206.                                         <a href="#">
  207.                                             <div class="row align-items-center">
  208.                                                 <div class="col">
  209.                                                     <h5 class="mb-1">{{ post.title }}</h5>
  210.                                                     <p class="text-body small mb-0">{{ post.createdAt|format_date('medium') }}</p>
  211.                                                 </div>
  212.                                                 <!-- End Col -->
  213.                                                 <div class="col-auto">
  214.                                                     <i class="bi-chevron-right"></i>
  215.                                                 </div>
  216.                                                 <!-- End Col -->
  217.                                             </div>
  218.                                             <!-- End Row -->
  219.                                         </a>
  220.                                     </li>
  221.                                     <!-- End Item -->
  222.                                 {% endfor %}
  223.                             </ul>
  224.                             <!-- End List Group -->
  225.                         </div>
  226.                         {% endif %}
  227.                     </div>
  228.                 </div>
  229.                 <!-- End Col -->
  230.             </div>
  231.             <!-- End Row -->
  232.         </div>
  233.         <!-- End Card Grid -->
  234.         <!-- Hero -->
  235.         <div class="shape-container overflow-hidden">
  236.             <div class="bg-dark"
  237.                  style="background-image: url({{ asset('build/front_v4/svg/components/wave-pattern-light.svg') }});">
  238.                 <div class="container content-space-1 content-space-t-md-3 content-space-b-md-4">
  239.                     <div class="position-relative w-lg-75 text-center mx-lg-auto">
  240.                         <div class="mb-7">
  241.                             <h1 class="fw-normal mb-4 font-size-md-down-1 text-white">A propos du <span
  242.                                         class="text-warning fw-semibold">blog</span></h1>
  243.                             <p class="d-block d-inline lead text-white">
  244.                                 <span class="text-warning">Mon Centre Auditif</span> s’efforce à travers ce blog de vous
  245.                                 informer sur l’univers de l’audition.
  246.                                 Notre objectif est de rendre l’accès aux <strong>soins auditifs</strong> plus simple et
  247.                                 plus fluide pour les
  248.                                 personnes en recherche d’équipement. <br>
  249.                                 Du <strong>bilan auditif</strong> jusqu’à l’appareillage en passant par la prescription
  250.                                 médicale de l’ORL, nous allons
  251.                                 ensemble aborder les différents sujets qui entourent la perte auditive.<br><br>
  252.                                 Vous avez des questions ou des doutes sur votre santé auditive, n’hésitez pas à
  253.                                 consulter un
  254.                                 professionnel proche de chez vous. <br>
  255.                                 Nos différents rédacteurs vous apporteront un maximum d’informations vulgarisées sur les
  256.                                 solutions
  257.                                 auditives du marché, les mécanismes de remboursements, les dernières technologies et
  258.                                 l’actualité de
  259.                                 l’univers de l’audioprothèse.
  260.                             </p>
  261.                         </div>
  262.                         <!-- End Row -->
  263.                     </div>
  264.                 </div>
  265.             </div>
  266.             <!-- Shape -->
  267.             <div class="shape shape-bottom zi-1" style="margin-bottom: -.125rem">
  268.                 <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 1920 100.1">
  269.                     <path fill="#fff" d="M0,0c0,0,934.4,93.4,1920,0v100.1H0L0,0z"></path>
  270.                 </svg>
  271.             </div>
  272.             <!-- End Shape -->
  273.         </div>
  274.         <!-- End Hero -->
  275.     </main>
  276.     <!-- ========== END MAIN CONTENT ========== -->
  277. {% endblock content %}
  278. {% block javascripts %}
  279.     {{ encore_entry_script_tags('blog_list') }}
  280. {% endblock javascripts %}