templates/front/theme1/produits/page_categorie.html.twig line 1

Open in your IDE?
  1. {% extends "front/"~ app.request.server.get('APP_THEME') ~"/base.html.twig" %}
  2. {% block preload %}
  3.     {% if categorie.image is defined  and categorie.image is not empty %}
  4.             <link rel="preload" as="image" href="{{asset_image(categorie.image)}}" />
  5.     {% endif %}
  6.     {% if resultats is defined and resultats is not empty  %}
  7.            {% for item in resultats %}
  8.                 {% if item.image %}
  9.                     <link rel="preload" as="image" href="{{asset_image(item.image)}}" /> 
  10.                 {% endif %}
  11.            {% endfor %}    
  12.     {% endif %}
  13.     {% if galleries is defined and galleries is not empty %}
  14.            {% for item in galleries %}
  15.                 {% if item.path is defined %}
  16.                     <link rel="preload" as="image" href="{{asset_image_gallery(item.path)}}" />
  17.                 {% endif %}
  18.            {% endfor %}
  19.     {% endif %}
  20. {% endblock %}
  21. {% block stylesheets %}
  22.     {{parent()}}
  23.     {% if modele_galerie[0].type == 4 %}
  24.         <link rel="stylesheet" type="text/css" href="{{asset('templates/front/theme1/assets/plugins/flexslider/flexslider.css')}}" media="screen" >
  25.     {% endif %}
  26.     {% if template.css is defined %}
  27.         <style>
  28.             {{template.css|raw}}
  29.         </style>
  30.     {% endif %}
  31. {% endblock %}
  32. {% block body %}
  33.     <div class="page_product">
  34.         {% if categorie.imageBandeau %}
  35.             {% set imagebandeau = categorie.imageBandeau %}
  36.         {% elseif parametre.imageBandeau %}
  37.             {% set imagebandeau = 'uploads/images/' ~ parametre.imageBandeau %}
  38.         {% else %}
  39.             {% set imagebandeau = '' %}
  40.         {% endif %}
  41.         
  42.         {% if imagebandeau != '' %}
  43.             <section class="image-bandeau text-center">
  44.                 <img alt="{{categorie.titrecategorie}}" title="{{categorie.titrecategorie}}" src="{{asset(imagebandeau)}}" />
  45.                 <div class="cnt-bandeau text-center">
  46.                     <div class="container-fluid wrapper">
  47.                         <ol class="breadcrumb d-flex justify-content-center" itemscope itemtype="http://schema.org/BreadcrumbList">
  48.                             <li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="{{path('index_page_home')}}" itemprop="item"><span itemprop="name">{{title_home_ariane}}</span></a><meta itemprop="position" content="1" /></li>
  49.                                 {% if categorieParent is defined %}<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="{{path('page',{slug:categorieParent.slugurl})}}" title="{{categorieParent.titrecategorie}}" itemprop="item"><span itemprop="name">{{categorieParent.titrecategorie}}</span></a><meta itemprop="position" content="2" /></li>{% endif %}
  50.                             <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">{{categorie.titrecategorie}}</span><meta itemprop="position" content="3" /></li>
  51.                         </ol>
  52.                         <h1 class="page-title titre_page_mention">{{categorie.titrecategorie}}</h1>
  53.                     </div>
  54.                 </div>
  55.             </section>
  56.         {% endif %}
  57.         {% if categorie.positiontext == 3 %}
  58.             {% set position_texte = "text-left"  %}
  59.         {% elseif categorie.positiontext == 2 %}
  60.             {% set position_texte = "text-right"  %}
  61.         {% else %}
  62.             {% set position_texte = "text-center"  %}
  63.         {% endif %}
  64.         {% set type_affiche = "" %}
  65.         {% if categorie.nombrearticle == 1 %}
  66.             {% set type_affiche = "type_affiche1"  %}
  67.         {% elseif categorie.nombrearticle == 2 %}
  68.             {% set type_affiche = "type_affiche2"  %}
  69.         {% else %}
  70.             {% set type_affiche = "type_affiche3"  %}
  71.         {% endif %}
  72.         {% if categorie.actif_slider == 1 %}
  73.             {% set type_affiche = type_affiche ~ " owl-carousel"  %}
  74.         {% endif %}
  75.         {% set multi_affichage = "affichage1"  %}
  76.         {% if categorie.multi_affichage == 1 %}
  77.             {% set multi_affichage = "affichage1"  %}
  78.         {% elseif categorie.multi_affichage == 2 %}
  79.             {% set multi_affichage = "affichage2"  %}
  80.         {% elseif categorie.multi_affichage == 3 %}
  81.             {% set multi_affichage = "affichage3"  %}
  82.         {% elseif categorie.multi_affichage == 4 %}
  83.             {% set multi_affichage = "affichage4"  %}
  84.         {% elseif categorie.multi_affichage == 5 %}
  85.             {% set multi_affichage = "affichage5"  %}
  86.         {% elseif categorie.multi_affichage == 6 %}
  87.             {% set multi_affichage = "affichage6"  %}
  88.         {% elseif categorie.multi_affichage == 7 %}
  89.             {% set multi_affichage = "affichage7"  %}
  90.         {% elseif categorie.multi_affichage == 8 %}
  91.             {% set multi_affichage = "affichage8"  %}
  92.         {% elseif categorie.multi_affichage == 9 %}
  93.             {% set multi_affichage = "affichage9"  %}
  94.         {% elseif categorie.multi_affichage == 10 %}
  95.             {% set multi_affichage = "affichage10"  %}
  96.         {% elseif categorie.multi_affichage == 11 %}
  97.             {% set multi_affichage = "affichage11"  %}
  98.         {% elseif categorie.multi_affichage == 12 %}
  99.             {% set multi_affichage = "affichage12"  %}
  100.         {% endif %}
  101.         <div class="page_cms pt-5">
  102.             {% if imagebandeau == '' %}
  103.                 <div class="breadcrumb-style-default">
  104.                     <div class="container">
  105.                         <div class="row">
  106.                             <div class="col-lg-12">
  107.                                 <div class="inner text-center">
  108.                                     {% if breadcrumb is defined and breadcrumb is not empty %}
  109.                                         {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/partials/breadcrumb.html.twig')}}
  110.                                         <h1 class="page-title">{{breadcrumb|last.name}}</h1>
  111.                                     {% endif %}
  112.                                 </div>
  113.                             </div>
  114.                         </div>
  115.                     </div>
  116.                 </div>
  117.             {% endif %}
  118.             <div class="container-fluid mt-3">
  119.                 <div class="row gx-5 py-2">
  120.                     {% if categories_tree is defined and categories_tree is not empty %}
  121.                         <div class="col-lg-3 {{show_filter_categorie is defined and show_filter_categorie == true?'':'d-none'}}" >
  122.                             {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/partials/product/_sidebar.html.twig')}}
  123.                         </div>
  124.                     {% endif %}
  125.                     
  126.                     <div class="col-lg-{{show_filter_categorie is defined and show_filter_categorie == true?'9':'12'}} bloc-content-categorie {{categorie.actif_haut == false and categorie.textecategorie is not empty ? "d-flex flex-column-reverse"}}">
  127.                         {% if categorie.textecategorie is not empty and categorie.textecategorie != "" %}
  128.                             <div class="list_blocs {{position_texte}}">
  129.                                 <div class="col-lg-12 content_post">
  130.                                     <div class="texte-content">{{categorie.textecategorie|raw}}</div>
  131.                                     {% if categorie.typelien != 1 %}
  132.                                             {% if categorie.typelien == '4' %}
  133.                                                 <div class="text-center py-2 bouton-categorie">
  134.                                                     <a href="tel:{{categorie.telephone}}" class="btn btn-back-pulse">{{categorie.titrelien}}</a>
  135.                                                 </div>
  136.                                             {% elseif categorie.typelien == '2' %}
  137.                                                 <div class="text-center py-2 bouton-categorie">
  138.                                                     <a href="{{slug_link_interne(categorie.lieninterne)}}" class="btn btn-back-pulse">{{categorie.titrelien}}</a>
  139.                                                 </div>
  140.                                             {% elseif categorie.typelien == '3' %}
  141.                                                 <div class="text-center py-2 bouton-categorie">
  142.                                                     <a href="{{categorie.lienexterne}}" class="btn btn-back-pulse" target="_blank">{{categorie.titrelien}}</a>
  143.                                                 </div>
  144.                                             {% endif %}
  145.                                     {% endif %}
  146.                                 </div>
  147.                             </div>
  148.                         {% endif %}
  149.                         <div class="blocs">
  150.                         
  151.                             {% if template is defined and template is not empty %}
  152.                                 {{ include(template_from_string(template.twig)) }}
  153.                             {% endif %}
  154.                             
  155.                             {% if pagination == true and posts.hasToPaginate and posts.pageSize %}
  156.                                 <div class="pagination-items">
  157.                                     {% set paginator = posts %}
  158.                                     <div class="navigation text-center">
  159.                                         <ul class="pagination d-felx justify-content-center my-4">
  160.                                             {% if paginator.hasPreviousPage %}
  161.                                                 <li class="prev mx-1"><a href="{{ path('page', {slug:categorie.slugurl}) }}?page={{paginator.previousPage}}" rel="previous"><i class="fa fw fa-long-arrow-left"></i> {{ 'paginator.previous'|trans([],'variable') }}</a></li>
  162.                                             {% else %}
  163.                                                 <li class="prev disabled mx-1"><span><i class="fa fw fa-long-arrow-left"></i> {{ 'paginator.previous'|trans([],'variable') }}</span></li>
  164.                                             {% endif %}
  165.                                             {% if paginator and paginator.pageSize %}
  166.                                                 {% for i in 1..paginator.lastPage %}
  167.                                                     {% if i == paginator.currentPage %}
  168.                                                         <li class="active number mx-1"><span>{{ i }} </span></li>
  169.                                                     {% else %}
  170.                                                         <li class="number mx-1"><a href="{{ path('page', {slug:categorie.slugurl }) }}?page={{i}}">{{ i }}</a></li>
  171.                                                     {% endif %}
  172.                                                 {% endfor %}
  173.                                             {% endif %}
  174.                                             {% if paginator and paginator.pageSize %}
  175.                                                 {% if paginator.hasNextPage %}
  176.                                                     <li class="next mx-1"><a href="{{ path('page', {slug:categorie.slugurl}) }}?page={{paginator.nextPage}}" rel="next">{{ 'paginator.next'|trans([],'variable') }}  <i class="fa fw fa-long-arrow-right"></i></a></li>
  177.                                                 {% else %}
  178.                                                     <li class="next disabled mx-1"><span>{{ 'paginator.next'|trans([],'variable')}} <i class="fa fw fa-long-arrow-right"></i></span></li>
  179.                                                 {% endif %}
  180.                                             {% endif %}
  181.                                             
  182.                                         </ul>
  183.                                     </div>
  184.                                 </div>
  185.                             {% endif %}
  186.                         </div>
  187.                     </div> 
  188.                 </div>
  189.             </div>
  190.             {% if galleries and galleries is not empty and template_model_gallerie is defined and template_model_gallerie is not empty %}
  191.                 {{ include(template_from_string(template_model_gallerie)) }}
  192.             {% endif %}
  193.             
  194.             {% if categorie.urlvideo is not empty %}
  195.                 <div class="container-fluid wrapper mt-3">
  196.                     <div class="col-md-12 mt-1">
  197.                         <div class="video">
  198.                             {% set id_video_externe = categorie.urlvideo|split('?v=')[1] is defined ? categorie.urlvideo|split('?v=')[1] : null %}
  199.                             <a class="video-thumbnail m-0" href="{{categorie.urlvideo}}" data-fancybox="video">
  200.                                 <img src="https://img.youtube.com/vi/{{id_video_externe}}/maxresdefault.jpg" class="img-fluid" alt=""/>
  201.                             </a>
  202.                         </div>
  203.                     </div>
  204.                 </div>
  205.             {% endif %}
  206.             {% if blocs is defined  %}
  207.                 {% for bloc in blocs.Bloc %}
  208.                     {% if is_mobile() and  bloc.mobile == true   %}
  209.                         {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/bloc/bloc.html.twig',{
  210.                             bloc: bloc,
  211.                         }, with_context = false)}}
  212.                     {% endif %}
  213.                     
  214.                     {% if is_full_view() and is_mobile() == false and bloc.desktop == true %}
  215.                         {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/bloc/bloc.html.twig',{
  216.                             bloc: bloc,
  217.                         }, with_context = false)}}
  218.                     {% endif %}
  219.                 {% endfor %}
  220.             {% endif %} 
  221.         </div> 
  222.     </div>
  223. {% endblock %}
  224. {% block javascripts %}
  225.     {{parent()}}
  226.     {% if modele_galerie[0].type == 4 %}
  227.         <script src="{{asset('templates/front/theme1/assets/plugins/flexslider/jquery.flexslider.js')}}" ></script>
  228.         <script>    
  229.             /*-------------------------------------------------*/
  230.             /* =  Sx flexslider 
  231.             /*-------------------------------------------------*/
  232.             if ($(".sx_flexslider").length) {
  233.             $('.flex-carousel').flexslider({
  234.             animation: "slide",
  235.             controlNav: false,
  236.             animationLoop: true,
  237.             slideshow: false,
  238.             itemWidth: 150,
  239.             asNavFor: '.flex-slider'
  240.             });
  241.             $('.flex-slider').flexslider({
  242.             animation: "slide",
  243.             controlNav: false,
  244.             animationLoop: true,
  245.             slideshow: false,
  246.             sync: ".flex-carousel"
  247.             });
  248.             }
  249.         </script>
  250.     {% endif %}
  251.     
  252. {% endblock %}