templates/theme/default/page_categorie_custom.html.twig line 1

Open in your IDE?
  1. {% extends "theme/"~ app.request.server.get('APP_THEME') ~"/partials/base.html.twig" %}
  2. {% block stylesheets %}
  3. {{parent()}}
  4. {% if categorie.customstyle is not empty %}
  5. <style>{{categorie.customstyle|raw}}</style>
  6. {% endif %}
  7. {% endblock %}
  8. {% block body %}
  9. <div id="{{id_page}}" class="page-categorie">
  10. {% if breadcrumb is defined and breadcrumb is not empty %}
  11. {{ include ('theme/'~ app.request.server.get('APP_THEME') ~'/partials/breadcrumb.html.twig',{
  12. breadcrumb: breadcrumb,
  13. titre_page: titre_page|default(''),
  14. image_bandeau: image_bandeau,
  15. image_bandeau_alt:image_bandeau_alt
  16. }, with_context = false)}}
  17. {% endif %}
  18. {% if categorie.textecategorie is not empty or categorie.urlvideo is not empty or galleries is not empty or articles is not empty or liste_sous_categorie is not empty %}
  19. <div class="container-fluid content-wrapper">
  20. <div class="content-area">
  21. <div class="row content_page">
  22. {% if categorie.image is not empty or categorie.textecategorie is not empty or categorie.typelien != 1 %}
  23. <div class="col-sm-12 {{ { '1': 'text-center', '2': 'text-start', '3': 'text-end' }[categorie.positiontext] | default('1') }}" >
  24. {% if categorie.image is not empty %}
  25. <div class="col-image-post text-center">
  26. <img class="img-fluid principal-img" src="{{asset_image(categorie.image,'medium',['1024x/uploads','800x/uploads','800x/uploads'])}}" alt="{{categorie.altimage is not empty ? categorie.altimage : categorie.titrecategorie}}" />
  27. </div>
  28. {% endif %}
  29. {% set lien_site = "<a href="~websiteUrl()~" title="~site_parameters.getParameters().titre~">"~websiteUrl()~"</a>" %}
  30. {% if categorie.textecategorie is not empty %}
  31. <div class="texte-content">{{ContentChangeByMotCle(categorie.id,categorie.textecategorie|replace({'[NDD]':lien_site}))|raw}}</div>
  32. {% endif %}
  33. {% if categorie.typelien != 1 %}
  34. {% if categorie.typelien == '4' %}
  35. <div class="text-center py-2">
  36. <a href="tel:{{categorie.telephone}}" class="btn btn-theme py-3 px-5 mt-3 btn-plus">{{categorie.titrelien}}</a>
  37. </div>
  38. {% elseif categorie.typelien == '2' %}
  39. <div class="text-center py-2">
  40. <a href="{{resolveInternalSlugLink(categorie.lieninterne)}}" class="btn btn-theme py-3 px-5 mt-3 btn-plus">{{categorie.titrelien}}</a>
  41. </div>
  42. {% elseif categorie.typelien == '3' %}
  43. <div class="text-center py-2">
  44. <a href="{{categorie.lienexterne}}" target="_blank" class="btn btn-theme py-3 px-5 mt-3 btn-plus">{{categorie.titrelien}}</a>
  45. </div>
  46. {% endif %}
  47. {% endif %}
  48. </div>
  49. {% endif %}
  50. {% if categorie.urlvideo is not empty %}
  51. <div class="col-sm-12">
  52. <div class="contenu-video">
  53. {% set id_video_externe = extract_youtube_id(categorie.urlvideo) %}
  54. <a class="video-thumbnail m-0" href="{{categorie.urlvideo}}" data-fancybox="video">
  55. <img src="https://img.youtube.com/vi/{{id_video_externe}}/maxresdefault.jpg" class="img-fluid" alt="youtube vidéo"/>
  56. </a>
  57. </div>
  58. </div>
  59. {% endif %}
  60. {% if galleries and galleries is not empty and twig_galerie is defined and twig_galerie is not empty %}
  61. <div class="col-sm-12">
  62. {{ include(template_from_string(twig_galerie)) }}
  63. </div>
  64. {% endif %}
  65. {% if liste_sous_categorie is defined and liste_sous_categorie is not empty %}
  66. {% for item in liste_sous_categorie %}
  67. <div class="col-sm-12 col-md-2">
  68. {% if systemName == "actualites" %}
  69. {% set link = item.slugurl %}
  70. {% else %}
  71. {% set link = app.request.attributes.get('slug') ~'/'~ item.slugurl %}
  72. {% endif %}
  73. <a href="{{path('page',{slug: link})}}">
  74. <div class="cta-categorie">
  75. {{item.titrecategorie}}
  76. </div>
  77. </a>
  78. </div>
  79. {% endfor %}
  80. {% endif %}
  81. {% set resultats = categorie.pagination == true ?articles.results:articles %}
  82. {% if resultats is not empty %}
  83. <div class="col-sm-12">
  84. <hr/>
  85. {% set data_columns = { '0':'3','1': '3', '2': '1', '4': '1' }[categorie.multiaffichage] %}
  86. {% set data_style = { '0':'compact','1': 'compact', '2': 'wide', '4': 'wide' }[categorie.multiaffichage] %}
  87. {% if template is defined and template is not empty %}
  88. {{ include(template_from_string(template.twig)) }}
  89. {% endif %}
  90. {% if categorie.pagination == true and articles.pageSize and categorie.pagesize < resultats|length %}
  91. <div class="pagination-items">
  92. {% set paginator = articles %}
  93. <div class="navigation text-center">
  94. <ul class="pagination d-felx justify-content-center align-items-center my-4">
  95. {% if paginator.hasPreviousPage %}
  96. <li class="prev mx-1"><a href="{{ path('page', {slug:categorie.slugurl}) }}?page={{paginator.previousPage}}" rel="previous"><i class="fa-solid fa-arrow-left-long"></i> {{ 'paginator.previous'|trans([],'variable') }}</a></li>
  97. {% else %}
  98. <li class="prev disabled mx-1"><span><i class="fa-solid fa-arrow-left-long"></i> {{ 'paginator.previous'|trans([],'variable') }}</span></li>
  99. {% endif %}
  100. {% if paginator and paginator.pageSize %}
  101. {% for i in 1..paginator.lastPage %}
  102. {% if i == paginator.currentPage %}
  103. <li class="active number mx-1"><span>{{ i }} </span></li>
  104. {% else %}
  105. <li class="number mx-1"><a href="{{ path('page', {slug:categorie.slugurl}) }}?page={{i}}">{{ i }}</a></li>
  106. {% endif %}
  107. {% endfor %}
  108. {% endif %}
  109. {% if paginator and paginator.pageSize %}
  110. {% if paginator.hasNextPage %}
  111. <li class="next mx-1"><a href="{{ path('page', {slug:categorie.slugurl}) }}?page={{paginator.nextPage}}" rel="next">{{ 'paginator.next'|trans([],'variable') }} <i class="fa-solid fa-arrow-right-long"></i></a></li>
  112. {% else %}
  113. <li class="next disabled mx-1"><span>{{ 'paginator.next'|trans([],'variable')}} <i class="fa-solid fa-arrow-right-long"></i></span></li>
  114. {% endif %}
  115. {% endif %}
  116. </ul>
  117. </div>
  118. </div>
  119. {% endif %}
  120. </div>
  121. {% endif %}
  122. {% if categorie.textecategorie2 is not empty %}
  123. <div class="col-sm-12 {{ { '1': 'text-center', '2': 'text-start', '3': 'text-end' }[categorie.positiontext] | default('1') }}">
  124. <div class="texte-content">{{ContentChangeByMotCle(categorie.id,categorie.textecategorie2|replace({'[NDD]':lien_site}))|raw}}</div>
  125. </div>
  126. {% endif %}
  127. </div>
  128. </div>
  129. </div>
  130. {% endif %}
  131. {% if blocs is defined %}
  132. {{ include ('theme/'~ app.request.server.get('APP_THEME') ~'/partials/bloc_render.html.twig',{blocs: blocs}, with_context = false)}}
  133. {% endif %}
  134. </div>
  135. {% endblock %}