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