templates/vitrine/articles/list.html.twig line 1

Open in your IDE?
  1. {% extends 'vitrine/layout.html.twig' %}
  2. {% set pageParam = app.request.query.get('page') %}
  3. {% block title %}{{ page.shortTitle }} {#% if app.request.query.has('page') %}- Page {{ pageParam }}{% endif %#}{% endblock title %}
  4. {% block description %}{{ page.shortDescription }}{% endblock description %}
  5. {% block robots %}{{ page.robots }}{% endblock robots %}
  6. {% block meta_social %}
  7. {{ parent() }}
  8. {% include "/vitrine/components/socialmedia.html.twig" with { 'page':page,'social_type':'website' } %}
  9. {% endblock meta_social %}
  10. {% block canonical %}{% include "/vitrine/components/canonical.html.twig" with {'page':page} %}{% endblock canonical %}
  11. {% block header_languages %}{% include "/vitrine/components/header_languages.html.twig" with {'page':page} %}{% endblock header_languages %}
  12. {% block footer_languages %}{% include "/vitrine/components/footer_languages.html.twig" with {'page':page} %}{% endblock footer_languages %}
  13. {% block body %}
  14. <section id="blog-page" class="pb-40 inner-page-hero blog-page-section division">
  15. <div class="container">
  16. <div class="row">
  17. <div class="col">
  18. <div class="posts-category ico-20">
  19. <h1>{{ page.title }} <span class="flaticon-next"></span></h1>
  20. </div>
  21. </div>
  22. </div>
  23. {% if articles is not empty %}
  24. <div class="posts-wrapper">
  25. <div class="row">
  26. {% for article in articles %}
  27. {% if app.request.locale == "en" %}
  28. {% set urlArticle = path('blog_article',{'slug': article.slug}) %}
  29. {% if article.pageslug3 is not empty %}
  30. {% set urlArticle = '/' ~ article.pageslug ~ '/' ~ article.pageslug2 ~ '/' ~ article.pageslug3 %}
  31. {% elseif article.pageslug2 is not empty %}
  32. {% set urlArticle = '/' ~ article.pageslug ~ '/' ~ article.pageslug2 %}
  33. {% elseif article.pageslug is not empty %}
  34. {% set urlArticle = '/' ~ article.pageslug %}
  35. {% endif %}
  36. {% else %}
  37. {% set urlArticle = path('locale_blog_article',{'_locale':app.request.locale,'slug': article.slug}) %}
  38. {% if article.pageslug3 is not empty %}
  39. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug ~ '/' ~ article.pageslug2 ~ '/' ~ article.pageslug3 %}
  40. {% elseif article.pageslug2 is not empty %}
  41. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug ~ '/' ~ article.pageslug2 %}
  42. {% elseif article.pageslug is not empty %}
  43. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug %}
  44. {% endif %}
  45. {% endif %}
  46. <div class="col-md-4">
  47. <div class="blog-post">
  48. <div class="blog-post-img r-12">
  49. <a href="{{ urlArticle }}">
  50. {% if article.image.name is not null %}
  51. <figure class="image">
  52. <picture>
  53. <source srcset="{{ replaceInWebP2(vich_uploader_asset(article, 'imageFile')) }}" type="image/webp">
  54. <img class="img-fluid r-16" src="{{ replaceInWebP2(vich_uploader_asset(article, 'imageFile')) }}" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" width="396" height="396" loading="lazy" />
  55. </picture>
  56. </figure>
  57. {% else %}
  58. <figure class="image">
  59. <picture>
  60. <source srcset="/uploads/default_article.webp" type="image/webp">
  61. <img class="img-fluid r-16" src="/uploads/default_article.webp" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" width="396" height="396" loading="lazy" />
  62. </picture>
  63. </figure>
  64. {% endif %}
  65. </a>
  66. </div>
  67. <div class="blog-post-txt">
  68. {% if article.authorArticle is not null %}
  69. <span class="post-tag color--theme">{{ article.authorArticle.title }}</span>
  70. {% endif %}
  71. <h2 style="font-size:25px;">
  72. <a href="{{ urlArticle }}">{{ article.title }}</a>
  73. </h2>
  74. {% if article.subtitle is not empty %}{{ articleResumeChain(article.subtitle,100) }}{% endif %}
  75. </div>
  76. </div>
  77. </div>
  78. {% endfor %}
  79. </div>
  80. </div>
  81. {% endif %}
  82. </div>
  83. </section>
  84. {% endblock body %}