thumbnails.html.twig 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {% for item in module.header.list %}
  2. {# img thumb #}
  3. {% set image_parts = pathinfo(item.img_thumb) %}
  4. {% set image_basename_thumb = image_parts.basename %}
  5. {% set image_page_thumb = image_parts.dirname == '.' ? module : module.find(image_parts.dirname) %}
  6. {% set titleHyp = item.title|lower|hyphenize %}
  7. {% if titleHyp == "bien-tre" %}
  8. {% set color = "__blue" %}
  9. {% elseif titleHyp == "nature" %}
  10. {% set color = "__green" %}
  11. {% elseif titleHyp == "gastronomie" %}
  12. {% set color = "__red" %}
  13. {% else %}
  14. {% set color = "__grey" %}
  15. {% endif %}
  16. <div id="{{titleHyp}}" class="{{section}} __thumbnails">
  17. <div class="__title">
  18. <div class="__d-inline">
  19. <span>{{item.title}}</span>
  20. </div>
  21. </div>
  22. <div class="__thumb __hover">
  23. {% if section == 'pack' %}
  24. <a href="#">
  25. <div class="__images">
  26. {% include 'components/thumbnails/img_tbn.html.twig' with { list: 'true'} %}
  27. </div>
  28. {% include 'components/buttons/btn.html.twig' with { btn: 'more'} %}
  29. </a>
  30. {% else %}
  31. <a target="_blank" href=" {{item.btn_url}} ">
  32. <div class="__images">
  33. {% include 'components/thumbnails/img_tbn.html.twig' with { list: 'true'} %}
  34. </div>
  35. {% include 'components/buttons/btn.html.twig' with { btn: 'link_ext'} %}
  36. </a>
  37. {% endif %}
  38. </div>
  39. {% if section == 'pack' %}
  40. {% include 'components/learn_more/more.html.twig' %}
  41. {% endif %}
  42. </div>
  43. {% endfor %}
  44. {% if section == 'pack' %}
  45. <div id="envie" class="{{section}} __thumbnails">
  46. <div class="__title">
  47. <div class="__d-inline">
  48. <span>{{module.header.title_envie}}</span>
  49. </div>
  50. </div>
  51. <div class="__thumb">
  52. <a target="_blank" href="{{module.header.btn_url_envie}}">
  53. <div class="__images ">
  54. {% include 'components/thumbnails/img_tbn.html.twig' with { list: 'false'} %}
  55. </div>
  56. {% include 'components/buttons/btn.html.twig' with { btn: 'envie'} %}
  57. </a>
  58. </div>
  59. </div>
  60. {% endif %}
  61. {% for item in module.header.list_offres %}
  62. {% set titleHyp = item.title|lower|hyphenize %}
  63. {% if titleHyp == "bien-tre" %}
  64. {% set color = "__blue" %}
  65. {% elseif titleHyp == "nature" %}
  66. {% set color = "__green" %}
  67. {% elseif titleHyp == "gastronomie" %}
  68. {% set color = "__red" %}
  69. {% else %}
  70. {% set color = "__grey" %}
  71. {% endif %}
  72. <div id="{{titleHyp}}" class="{{section}} __thumbnails">
  73. {% set image_parts = pathinfo(item.a_file) %}
  74. {% set image_basename_thumb = image_parts.basename %}
  75. {% set image_page_thumb = image_parts.dirname == '.' ? module : module.find(image_parts.dirname) %}
  76. <div class="__title">
  77. <div class="__d-inline">
  78. <span>{{item.title}}</span>
  79. </div>
  80. </div>
  81. <div class="__thumb">
  82. <div class="__images ">
  83. {{ image_page_thumb.media[image_basename_thumb].html() }}
  84. </div>
  85. </div>
  86. </div>
  87. {% endfor %}