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