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

Open in your IDE?
  1. {% extends "front/"~ app.request.server.get('APP_THEME') ~"/base.html.twig" %}
    
    {% block preload %}
        {% if categorie.image is defined  and categorie.image is not empty %}
                <link rel="preload" as="image" href="{{asset_image(categorie.image)}}" />
        {% endif %}
    
        {% if resultats is defined and resultats is not empty  %}
               {% for item in resultats %}
                    {% if item.image %}
                        <link rel="preload" as="image" href="{{asset_image(item.image)}}" /> 
                    {% endif %}
               {% endfor %}    
        {% endif %}
    
        {% if galleries is defined and galleries is not empty %}
               {% for item in galleries %}
                    {% if item.path is defined %}
                        <link rel="preload" as="image" href="{{asset_image_gallery(item.path)}}" />
                    {% endif %}
               {% endfor %}
        {% endif %}
    
    {% endblock %}
    
    
    {% block stylesheets %}
        {{parent()}}
        {% if modele_galerie[0].type == 4 %}
            <link rel="stylesheet" type="text/css" href="{{asset('templates/front/theme1/assets/plugins/flexslider/flexslider.css')}}" media="screen" >
        {% endif %}
        {% if modele_galerie[0].type == 10 %}
            <link rel="stylesheet" type="text/css" href="{{asset('templates/front/theme1/assets/plugins/pana-accordion-master/accordion.css')}}" media="screen" >
        {% endif %}
        {% if template.css is defined %}
            <style>
                {{template.css|raw}}
            </style>
        {% endif %}
    
        {% if custom_style is defined and custom_style is not empty %}
            <style>
                {{custom_style|raw}}
            </style>
        {% endif %}
    {% endblock %}
    
    
    {% block body %}
    
        {% if sous_categorie.positiontext == 3 %}
            {% set position_texte = "text-left"  %}
        {% elseif sous_categorie.positiontext == 2 %}
            {% set position_texte = "text-right"  %}
        {% else %}
            {% set position_texte = "text-center"  %}
        {% endif %}
    
        {% set type_affiche = "" %}
        {% if sous_categorie.nombrearticle == 1 %}
            {% set type_affiche = "type_affiche1"  %}
        {% elseif sous_categorie.nombrearticle == 2 %}
            {% set type_affiche = "type_affiche2"  %}
        {% else %}
            {% set type_affiche = "type_affiche3"  %}
        {% endif %}
    
        {% if sous_categorie.actif_slider == 1 %}
            {% set type_affiche = type_affiche ~ " owl-carousel"  %}
        {% endif %}
    
        {% set multi_affichage = "affichage1"  %}
    
        {% if sous_categorie.multi_affichage == 1 %}
            {% set multi_affichage = "affichage1"  %}
        {% elseif sous_categorie.multi_affichage == 2 %}
            {% set multi_affichage = "affichage2"  %}
        {% elseif sous_categorie.multi_affichage == 3 %}
            {% set multi_affichage = "affichage3"  %}
        {% elseif sous_categorie.multi_affichage == 4 %}
            {% set multi_affichage = "affichage4"  %}
        {% elseif sous_categorie.multi_affichage == 5 %}
            {% set multi_affichage = "affichage5"  %}
        {% elseif sous_categorie.multi_affichage == 6 %}
            {% set multi_affichage = "affichage6"  %}
        {% elseif sous_categorie.multi_affichage == 7 %}
            {% set multi_affichage = "affichage7"  %}
        {% elseif sous_categorie.multi_affichage == 8 %}
            {% set multi_affichage = "affichage8"  %}
        {% elseif sous_categorie.multi_affichage == 9 %}
            {% set multi_affichage = "affichage9"  %}
        {% elseif sous_categorie.multi_affichage == 10 %}
            {% set multi_affichage = "affichage10"  %}
        {% elseif sous_categorie.multi_affichage == 11 %}
            {% set multi_affichage = "affichage11"  %}
        {% elseif sous_categorie.multi_affichage == 12 %}
            {% set multi_affichage = "affichage12"  %}
        {% endif %}
    
        <div class="page_cms page_product">
            {% if sous_categorie.imageBandeau %}
                {% set imagebandeau =  asset_image(sous_categorie.imageBandeau,'medium',['files1920','files1920','files1200']) %}
            {% elseif parametre.imageBandeau %}
                {% set imagebandeau = asset('uploads/images/' ~ parametre.imageBandeau)  %}
            {% else %}
                {% set imagebandeau = '' %}
            {% endif %}
            
            <div class="{{imagebandeau != ''?'image-bandeau':'mt-5'}} text-center">
                {% if imagebandeau != '' %}
                    <img class="lazyload" alt="{{sous_categorie.altimagebandeau is not empty ? sous_categorie.altimagebandeau : sous_categorie.titrecategorie}}" title="{{sous_categorie.altimagebandeau is not empty ? sous_categorie.altimagebandeau : sous_categorie.titrecategorie}}" src="{{imagebandeau}}" />
                {% endif %}
                
                <div class="cnt-bandeau text-center">
                    <div class="breadcrumb-style-default">
                        <div class="container">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="inner text-center">
                                        {% if breadcrumb is defined and breadcrumb is not empty %}
                                            {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/partials/breadcrumb.html.twig')}}
                                            <h1 class="page-title">{{breadcrumb|last.name}}</h1>
                                        {% endif %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    
            {% if coordonnes_maps is defined and coordonnes_maps is not empty  %}
                    {{ include('front/'~ app.request.server.get('APP_THEME') ~'/bloc/bloc_maps.html.twig',{
                        bloc: coordonnes_maps,
                    }, with_context = false)}}     
            {% endif %}
    
            <div class="container-fluid mt-3">
                <div class="row gx-5 py-2 align-items-start">
                    {% if categories_tree is defined and categories_tree is not empty %}
                        <div class="col-lg-3 {{show_filter_categorie is defined and show_filter_categorie == true ?'':'d-none'}}">
                             {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/partials/product/_sidebar.html.twig')}}
                        </div>
                    {% endif %}
                    
                    <div class="col-lg-{{show_filter_categorie is defined and show_filter_categorie == true?'9':'12'}} bloc-content-sous-categorie {{sous_categorie.actif_haut == false and sous_categorie.textecategorie is not empty ? "d-flex flex-column-reverse"}}">
                        {% if sous_categorie.image is defined  and sous_categorie.image is not empty %}
                                <div class="col-md-12 my-3">
                                    <img class="img-fluid d-block m-auto" src="{{asset_image(sous_categorie.image)}}" alt="{{sous_categorie.altimage is not empty ? sous_categorie.altimage : sous_categorie.titrecategorie}}" width="400" />
                                </div>
                            {% endif %}
                        {% if sous_categorie.textecategorie is not empty and sous_categorie.textecategorie != "" or sous_categorie.typelien != 1 %}
                            <div class="list_blocs {{position_texte}}">
                                    <div class="col-lg-12 content_post">
                                        {{sous_categorie.textecategorie|raw}}
                                        {% if sous_categorie.typelien != 1 %}
                                                {% if sous_categorie.typelien == '4' %}
                                                    <div class="text-center py-2">
                                                        <a href="tel:{{sous_categorie.telephone}}" class="btn btn-back-pulse">{{sous_categorie.titrelien}}</a>
                                                    </div>
                                                {% elseif sous_categorie.typelien == '2' %}
                                                    <div class="text-center py-2">
                                                        <a href="{{slug_link_interne(sous_categorie.lieninterne)}}" class="btn btn-back-pulse">{{sous_categorie.titrelien}}</a>
                                                    </div>
                                                {% elseif sous_categorie.typelien == '3' %}
                                                    <div class="text-center py-2">
                                                        <a href="{{sous_categorie.lienexterne}}" class="btn btn-back-pulse" target="_blank">{{sous_categorie.titrelien}}</a>
                                                    </div>
                                                {% endif %}
                                        {% endif %}
                                    </div>
                            </div>
                        {% endif %}
    
                        <div class="blocs">
    
                            {% if param_post.actiftags and param_post.showcategories == 0 and all_categorie_tags is not empty %}
                                <div class="filtre-produits d-flex justify-content-end">
                                    <div class="filtre_tags">
                                        <label class="label">Filtrer par tag : </label>
                                        <select class="form-control" id="filtre-tags">
                                            <option value="all">Tous</option>
                                            {% for categorie_tags in all_categorie_tags %}
                                                {% set tags_categorie = categorie_tags|split(',') %}
                                                {% for t in tags_categorie %}
                                                    <option value="{{t|lower|replace({' ':''})}}">{{t}}</option>
                                                {% endfor %}
                                            {% endfor %}
                                        </select>
                                    </div>
                                </div>
                            {% endif %}
    
                            {% if template is defined and template is not empty %}
                                {{ include(template_from_string(template.twig)) }}
                            {% endif %}
                            
                            {% if pagination == true and posts.hasToPaginate and posts.pageSize %}
                                <div class="pagination-items">
                                    {% set paginator = posts %}
                                    <div class="navigation text-center">
                                        <ul class="pagination d-felx justify-content-center my-4">
                                            {% if paginator.hasPreviousPage %}
                                                <li class="prev mx-1"><a href="{{ path('page_sous_categorie', {categorie1:categorie.slugurl,categorie2:sous_categorie.slugurl}) }}?page={{paginator.previousPage}}" rel="previous"><i class="fa fw fa-long-arrow-left"></i> {{ 'paginator.previous'|trans([],'variable') }}</a></li>
                                            {% else %}
                                                <li class="prev disabled mx-1"><span><i class="fa fw fa-long-arrow-left"></i> {{ 'paginator.previous'|trans([],'variable') }}</span></li>
                                            {% endif %}
                                            {% if paginator and paginator.pageSize %}
                                                {% for i in 1..paginator.lastPage %}
                                                    {% if i == paginator.currentPage %}
                                                        <li class="active number mx-1"><span>{{ i }} </span></li>
                                                    {% else %}
                                                        <li class="number mx-1"><a href="{{ path('page_sous_categorie', {categorie1:categorie.slugurl,categorie2:sous_categorie.slugurl}) }}?page={{i}}">{{ i }}</a></li>
                                                    {% endif %}
                                                {% endfor %}
                                            {% endif %}
    
                                            {% if paginator and paginator.pageSize %}
                                                {% if paginator.hasNextPage %}
                                                    <li class="next mx-1"><a href="{{ path('page_sous_categorie', {categorie1:categorie.slugurl,categorie2:sous_categorie.slugurl}) }}?page={{paginator.nextPage}}" rel="next">{{ 'paginator.next'|trans([],'variable') }}  <i class="fa fw fa-long-arrow-right"></i></a></li>
                                                {% else %}
                                                    <li class="next disabled mx-1"><span>{{ 'paginator.next'|trans([],'variable')}} <i class="fa fw fa-long-arrow-right"></i></span></li>
                                                {% endif %}
                                            {% endif %}
                                            
                                        </ul>
                                    </div>
                                </div>
                            {% endif %}
                        </div>
                    </div> 
                </div>
            </div>
    
    
            {% if galleries and galleries is not empty and template_model_gallerie is defined and template_model_gallerie is not empty %}
                {{ include(template_from_string(template_model_gallerie)) }}
            {% endif %}
            
            {% if sous_categorie.urlvideo is not empty %}
                <div class="container-fluid wrapper mt-3">
                    <div class="col-md-12 mt-1">
                        <div class="video">
                            {% set id_video_externe = sous_categorie.urlvideo|extract_v %}
                            <a class="video-thumbnail m-0" href="{{sous_categorie.urlvideo}}" data-fancybox="video">
                                <img src="https://img.youtube.com/vi/{{id_video_externe}}/maxresdefault.jpg" class="img-fluid" alt=""/>
                            </a>
                        </div>
                    </div>
                </div>
            {% endif %}
    
            {% if blocs is defined  %}
                {% for bloc in blocs.Bloc %}
                    {% if is_mobile() and  bloc.mobile == true   %}
                        {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/bloc/bloc.html.twig',{
                            bloc: bloc,
                        }, with_context = false)}}
                    {% endif %}
                    
                    {% if is_full_view() and is_mobile() == false and bloc.desktop == true %}
                        {{ include ('front/'~ app.request.server.get('APP_THEME') ~'/bloc/bloc.html.twig',{
                            bloc: bloc,
                        }, with_context = false)}}
                    {% endif %}
                {% endfor %}
            {% endif %} 
    
        </div> 
    {% endblock %}
    
    {% block javascripts %}
        {{parent()}}
        {% if modele_galerie[0].type == 4 %}
            <script src="{{asset('templates/front/theme1/assets/plugins/flexslider/jquery.flexslider.js')}}" ></script>
            <script>    
                /*-------------------------------------------------*/
                /* =  Sx flexslider 
                /*-------------------------------------------------*/
                if ($(".sx_flexslider").length) {
                    $('.flex-carousel').flexslider({
                        animation: "slide",
                        controlNav: false,
                        animationLoop: true,
                        slideshow: false,
                        itemWidth: 150,
                        asNavFor: '.flex-slider'
                    });
    
                    $('.flex-slider').flexslider({
                        animation: "slide",
                        controlNav: false,
                        animationLoop: true,
                        slideshow: false,
                        sync: ".flex-carousel"
                    });
                }
            </script>
        {% endif %}
        {% if modele_galerie[0].type == 10 %}
            <script src="{{asset('templates/front/theme1/assets/plugins/pana-accordion-master/pana-accordion.js')}}" ></script>
            <script>    
                if ($(window).width() > 767){
                    accordion.init({
                    id: 'accordion',
                    autoPlay:false,
                    extpand:1,
                    expandWidth: $(window).width() - (($(window).width() / 4) * 2),
                    itemWidth: $(window).width() / 4,
                    });
                }
                if(window.innerWidth < 992){
                    var prk_panel_event="click";
                } else {
                    var prk_panel_event="hover";        
                }
                if(window.innerWidth >= 991){
                    /*    Height de bloc_header_bottom    */
                    var pos = 62;
                    $( "#sx-accordion .panel-counter" ).each(function() {
                    $(this).css({ top: pos });
                    pos = pos + 153;
                    });
                }
                if ( $( "#sx-accordion" ).length ) {
                    var headerH = $('header').outerHeight();
                    var heightHead = headerH+'px';
                    var heightcarousel = 'calc(100vh - '+heightHead+')';
                    $('#sx-accordion').accordionSlider({        
                    width:'100%',
                    height: heightcarousel,
                    shadow: true,
                    autoplay:false,
                    mouseDelay:100,
                    openPanelDuration:500,
                    closePanelDuration:500,
                    closePanelsOnMouseOut: true,
                    //mouseWheelTarget: 'page',
                    startPanel:-1,
                    maxOpenedPanelSize:'60%',
                    openPanelOn:prk_panel_event,
                    panelOverlap:false,
                    mouseWheel: false,
                    panelOpenComplete: function(event) {
                    },
                    panelClick: function(event) {
                    },
                    breakpoints: {
                        767: {
                        height: 508,
                        maxOpenedPanelSize:'50%',
                        orientation: 'vertical',
                        touchSwipe: false
                        }
                    }
                    });        
                }
            </script>
        {% endif %}
    
        <script type="text/javascript">
            $(document).ready(function() {
                if($('#filtre-tags').length){
                    $('#filtre-tags').on('change', function() {
                        var selectedTag = $(this).val();
    
                        if (selectedTag === 'all') {
                            $('.article').show(); // Afficher tous les articles
                        } else {
                            $('.article').hide(); // Cacher tous les articles
                            $('.article').each(function() {
                                if($(this).data('tags')){
                                    var articleTags = $(this).data('tags').split(' ');
                                    if (articleTags.indexOf(selectedTag) !== -1) {
                                        $(this).show(); // Afficher les articles avec le tag sélectionné
                                    }
                                }
                            });
                        }
                    });
                }
            });
        </script>
        
    {% endblock %}