blog-list-item.html.twig 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <div class="card">
  2. {% if page.template != "modular/news" %}
  3. <a href="{{ page.url }}">
  4. {% else %}
  5. {% if page.header.url_news %}
  6. <a href="{{ page.header.url_news }}" target="_blank">
  7. {% else %}
  8. {% endif %}
  9. {% endif %}
  10. {% set image = page.media.images|first %}
  11. <div class="card-header">
  12. {% if blog.template == 'home' %}
  13. <div class="card-cat">
  14. {% include 'partials/blog/cat.html.twig' %}
  15. </div>
  16. {% endif %}
  17. {% if blog.template != 'home' %}
  18. {% if page.template == 'events' %}
  19. {% for tax in page.taxonomy.category %}
  20. <div class="card-cat">
  21. <span>{{tax}}</span>
  22. </div>
  23. {% endfor %}
  24. {% endif %}
  25. {% endif %}
  26. <div class="card-title">
  27. {% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %}
  28. </div>
  29. <div class="card-date">
  30. {% include 'partials/blog/date.html.twig' %}
  31. </div>
  32. </div>
  33. {% if image %}
  34. <div class="card-image">
  35. {% if page.header.topH == true %}
  36. {{image.cropZoom(1400, 1000).sizes('(max-width:100vw) 100vw, 50vw').html(page.title, 'image article')}}
  37. {% else %}
  38. {{image.cropZoom(1400, 1000).sizes('(max-width:100vw) 100vw, 50vw').html(page.title, 'image article')}}
  39. {% endif %}
  40. </div>
  41. {% endif %}
  42. {% if page.template != "modular/news" %}
  43. </a>
  44. {% else %}
  45. {% if page.header.url_news %}
  46. </a>
  47. {% else %}
  48. {% endif %}
  49. {% endif %}
  50. </div>