templates/vitrine/components/elements/collections/articles.html.twig line 1

Open in your IDE?
  1. {% set articlesListing = getArticlesListing(app.request.locale,9) %}
  2. {% if articlesListing is not empty %}
  3. <section id="blog-1" class="pb-100 blog-section division" style="margin-top:150px;">
  4. <div class="container">
  5. <div class="section-title text-center mb-60">
  6. <h2 class="h2-xl">
  7. {% if app.request.locale == "en" %}
  8. Travel diaries
  9. {% else %}
  10. Carnets de voyage
  11. {% endif %}
  12. </h2>
  13. </div>
  14. <div class="row">
  15. {% for article in articlesListing %}
  16. {% if app.request.locale == "en" %}
  17. {% set urlArticle = path('blog_article',{'slug': article.slug}) %}
  18. {% if article.pageslug3 is not empty %}
  19. {% set urlArticle = '/' ~ article.pageslug ~ '/' ~ article.pageslug2 ~ '/' ~ article.pageslug3 %}
  20. {% elseif article.pageslug2 is not empty %}
  21. {% set urlArticle = '/' ~ article.pageslug ~ '/' ~ article.pageslug2 %}
  22. {% elseif article.pageslug is not empty %}
  23. {% set urlArticle = '/' ~ article.pageslug %}
  24. {% endif %}
  25. {% else %}
  26. {% set urlArticle = path('locale_blog_article',{'_locale':app.request.locale,'slug': article.slug}) %}
  27. {% if article.pageslug3 is not empty %}
  28. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug ~ '/' ~ article.pageslug2 ~ '/' ~ article.pageslug3 %}
  29. {% elseif article.pageslug2 is not empty %}
  30. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug ~ '/' ~ article.pageslug2 %}
  31. {% elseif article.pageslug is not empty %}
  32. {% set urlArticle = '/' ~ app.request.locale ~ '/' ~ article.pageslug %}
  33. {% endif %}
  34. {% endif %}
  35. <div class="col-md-6 col-lg-4">
  36. <div id="bp-1-1" class="blog-post ">
  37. <div class="blog-post-img mb-35">
  38. <a href="{{ urlArticle }}" aria-label="{{ article.title }}" title="{{ article.title }}">
  39. {% if article.image.name is not null %}
  40. <figure class="image">
  41. <picture>
  42. <source srcset="{{ replaceInWebP2(vich_uploader_asset(article, 'imageFile')) }}" type="image/webp">
  43. <img class="img-fluid r-16" src="{{ replaceInWebP2(vich_uploader_asset(article, 'imageFile')) }}" width="396" height="396" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" loading="lazy" />
  44. </picture>
  45. </figure>
  46. {% else %}
  47. <figure class="image">
  48. <picture>
  49. <source srcset="/uploads/default_article.webp" type="image/webp">
  50. <img class="img-fluid r-16" src="/uploads/default_article.webp" width="396" height="396" alt="{{ article.imageAlt }}" title="{{ article.imageTitle }}" loading="lazy" />
  51. </picture>
  52. </figure>
  53. {% endif %}
  54. </a>
  55. </div>
  56. <div class="blog-post-txt">
  57. <h3 class="s-20 w-700" style="margin-bottom:10px;">
  58. <a href="{{ urlArticle }}" aria-label="{{ article.title }}" title="{{ article.title }}">
  59. {{ article.title }}
  60. </a>
  61. </h3>
  62. {% if article.subtitle is not empty %}<div style="margin-bottom:10px;">{{ articleResumeChain(article.subtitle,100) }}</div>{% endif %}
  63. {#
  64. <div class="blog-post-meta mt-20" style="margin-bottom:15px;">
  65. <ul class="post-meta-list ico-10">
  66. <li><p class="p-sm">{{ article.updatedAt|format_date(pattern='dd MMMM yyyy',locale=app.request.locale) }}</p></li>
  67. </ul>
  68. </div>
  69. #}
  70. </div>
  71. </div>
  72. </div>
  73. {% endfor %}
  74. </div>
  75. </div>
  76. </section>
  77. {% endif %}