themes/webapicTheme/templates/bundles/BitBagSyliusCmsPlugin/Shop/Block/show.html.twig line 1

Open in your IDE?
  1. {% if block.typeblock == 26 %}{{ block.name|raw }}
  2. {% elseif block.typeblock == 27 %}{{ block.content|raw }}     
  3. {% else %} 
  4.     {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
  5.     {% if null != block.typeblock %}    
  6.         {# {{ dump(block) }} #}
  7.         {# une image titre à droite #}
  8.         {% if block.typeblock == 1 %}
  9.             {% set image_bg = '' %}         
  10.             {% if null != block.images %}
  11.                 {% for image in block.images %}
  12.                     {% set image_bg = asset('/media/image/'~image.path) %}
  13.                 {% endfor %}
  14.             {% endif %}
  15.             <div class="block-type1"  {% if null != image_bg  %}style="background-image: url('{{ image_bg }}')"{% endif %}>                
  16.                 {% if null != block.content %}
  17.                     <div class="block-type1-desc">
  18.                         {{ block.content|raw }}
  19.                     </div>
  20.                 {% endif %}
  21.                 {% if null != block.name %}
  22.                     <div class="block-type1-top">
  23.                         <h2>{{ block.name }}</h2>
  24.                     </div>
  25.                 {% endif %}                 
  26.             </div>
  27.         {% endif %}
  28.         {# une image titre à gauche #}  
  29.         {% if block.typeblock == 2 %}
  30.             {% set image_bg = '' %}         
  31.             {% if null != block.images %}
  32.                 {% for image in block.images %}
  33.                     {% set image_bg = asset('/media/image/'~image.path) %}
  34.                 {% endfor %}
  35.             {% endif %}
  36.             <div class="block-type2">      
  37.                 <div class="block-type2-ctn">          
  38.                     <div class="block-type2-left">     
  39.                         {% if null != block.name %}
  40.                             <div class="title">
  41.                                 <h2>{{ block.name }}</h2>
  42.                             </div>
  43.                         {% endif %}         
  44.                         {% if null != block.content %}
  45.                             <div class="desc">
  46.                                 {{ block.content|raw }}
  47.                             </div>
  48.                         {% endif %}                       
  49.                     </div> 
  50.                     <div class="block-type2-right"> 
  51.                         <img src="{{ image_bg }}">
  52.                     </div>
  53.                 </div>    
  54.             </div>
  55.         {% endif %}
  56.         {# caroussel #}
  57.         {% if block.typeblock == 3 %}
  58.             {% if null != block.taxons %}
  59.                 {% for taxon in block.taxons %}
  60.                     {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }}
  61.                 {% endfor %}
  62.             {% endif %}
  63.             
  64.         {% endif %}
  65.         {# texte uniquement #}
  66.         {% if block.typeblock == 4 %}
  67.             
  68.             {% if null != block.content %}  
  69.                 <div class="block-type4">                
  70.                     <div class="block-type4-ctn">                  
  71.                         {{ block.content|raw }}  
  72.                     </div>
  73.                 </div>              
  74.             {% endif %}                 
  75.         {% endif %}
  76.         {# image uniquement #}
  77.         {% if block.typeblock == 5 %}
  78.             {% if null != block.images %}
  79.                 <div class="block-type5">      
  80.                     {% for image in block.images %}
  81.                         {% set image_bg = asset('/media/image/'~image.path) %}
  82.                         <img src="{{ image_bg }}">
  83.                     {% endfor %}
  84.                 </div>
  85.             {% endif %}
  86.         {% endif %}
  87.         {# Image de fond avec texte, titre à gauche #}
  88.         {% if block.typeblock == 6 %}
  89.             {% set image_bg = '' %}         
  90.             {% if null != block.images %}
  91.                 {% for image in block.images %}
  92.                     {% set image_bg = asset('/media/image/'~image.path) %}
  93.                 {% endfor %}
  94.             {% endif %}
  95.             <div class="block-type1 block-type6"  {% if null != image_bg  %}style="background-image: url('{{ image_bg }}')"{% endif %}>                
  96.                 {% if null != block.content %}
  97.                     <div class="block-type1-desc">
  98.                         {{ block.content|raw }}
  99.                     </div>
  100.                 {% endif %}
  101.                 {% if null != block.name %}
  102.                     <div class="block-type1-top">
  103.                         <h2>{{ block.name }}</h2>
  104.                     </div>
  105.                 {% endif %}                 
  106.             </div>
  107.         {% endif %}
  108.         {# Bloc de taxon sans caroussel #}
  109.         {% if block.typeblock == 7 %}
  110.             {% set image_bg = '' %}         
  111.             {% if null != block.images %}
  112.                 {% for image in block.images %}
  113.                     {% set image_bg = asset('/media/image/'~image.path) %}
  114.                 {% endfor %}
  115.             {% endif %}
  116.             <div class="block-type7" {% if null != image_bg  %}style="background-image: url('{{ image_bg }}')"{% endif %}>             
  117.                 <div class="block-type7-ctn">              
  118.                     {% if null != block.name %}
  119.                         <div class="block-type7-top">
  120.                             <h2>{{ block.name }}</h2>
  121.                         </div>
  122.                     {% endif %}
  123.                     {% if null != block.taxons %}
  124.                         {% for taxon in block.taxons %}
  125.                             {# {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }}                     #}
  126.                             {% include '@SyliusShop/Webapic/page/taxon.html.twig' with {'taxons': taxon.children} only %}
  127.                             
  128.                         {% endfor %}
  129.                     {% endif %}
  130.                 </div>
  131.             </div>
  132.         {% endif %}
  133.         {# Bloc orange #}  
  134.         {% if block.typeblock == 8 %}
  135.             <div class="block-type8">      
  136.                 <div class="block-type8-ctn">          
  137.                     {% if null != block.name %}
  138.                         <div class="title">
  139.                             <h2>{{ block.name }}</h2>
  140.                         </div>
  141.                     {% endif %}         
  142.                     {% if null != block.content %}
  143.                         <div class="desc">
  144.                             {{ block.content|raw }}
  145.                         </div>
  146.                     {% endif %}                                       
  147.                 </div>    
  148.             </div>
  149.         {% endif %}
  150.         {# Bloc sans titre, texte à gauche, image à droite et encart bleu au dessus l\'image #}
  151.         {% if block.typeblock == 9 %}
  152.             {% set image_bg = '' %}         
  153.             {% if null != block.images %}
  154.                 {% for image in block.images %}
  155.                     {# {% set image_bg = asset('/media/image/'~image.path) %} #}
  156.                     {% set image_bg = image.path|imagine_filter(filter|default('app_any_image')) %}
  157.                 {% endfor %}
  158.             {% endif %}
  159.             <div class="block-type9">                
  160.                 {% if null != block.content %}
  161.                     <div class="block-type9-desc">
  162.                         {{ block.content|raw }}
  163.                     </div>
  164.                 {% endif %}
  165.             
  166.                 <div class="block-type9-right">
  167.                     
  168.                     {% if null != block.taxons %}
  169.                         {% for taxon in block.taxons %}
  170.                             {# {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }} #}                       
  171.                             {% include '@SyliusShop/Webapic/page/encartbleu.html.twig' with {'taxons': taxon.children} only %}
  172.                             
  173.                         {% endfor %}
  174.                     {% endif %}
  175.                     {% if null != image_bg  %}
  176.                         <img src="{{ image_bg }}">
  177.                     {% endif %}
  178.                 </div>
  179.             </div>
  180.         {% endif %}
  181.         {# Collection - Image avec texte, titre à gauche #}  
  182.         {% if block.typeblock == 10 %}
  183.             {% set image_bg = '' %}         
  184.             {% if null != block.images %}
  185.                 {% for image in block.images %}
  186.                     {% set image_bg = asset('/media/image/'~image.path) %}
  187.                 {% endfor %}
  188.             {% endif %}
  189.             <div class="block-type2 block-type10">      
  190.                 <div class="block-type2-ctn">          
  191.                     <div class="block-type2-left block-type10-left">     
  192.                         {% if null != block.name %}
  193.                             <div class="title">
  194.                                 <h2>{{ block.name }}</h2>
  195.                             </div>
  196.                         {% endif %}         
  197.                         {% if null != block.content %}
  198.                             <div class="desc">
  199.                                 {{ block.content|raw }}
  200.                             </div>
  201.                         {% endif %}                       
  202.                     </div> 
  203.                     <div class="block-type2-right"> 
  204.                         <img src="{{ image_bg }}">
  205.                     </div>
  206.                 </div>    
  207.             </div>
  208.         {% endif %}
  209.         {# Collection - Image avec texte à droite, sans titre #}  
  210.         {% if block.typeblock == 11 %}
  211.             {% set image_bg = '' %}         
  212.             {% if null != block.images %}
  213.                 {% for image in block.images %}
  214.                     {% set image_bg = asset('/media/image/'~image.path) %}
  215.                 {% endfor %}
  216.             {% endif %}
  217.             <div class="block-type11">      
  218.                 <div class="block-type11-ctn">          
  219.                     <div class="block-type11-left ">     
  220.                         <img src="{{ image_bg }}">
  221.                     </div> 
  222.                     {% if null != block.content %}
  223.                         <div class="block-type11-right ">  
  224.                             <div class="desc">
  225.                                 {{ block.content|raw }}
  226.                             </div>
  227.                         </div>
  228.                     {% endif %}                    
  229.                 </div>    
  230.             </div>
  231.         {% endif %}
  232.         {# Collection - image et produit #}  
  233.         {% if block.typeblock == 12 and null != block.products %}
  234.             {% set image_bg = '' %}         
  235.             {% if null != block.images %}
  236.                 {% for image in block.images %}
  237.                     {% set image_bg = asset('/media/image/'~image.path) %}
  238.                 {% endfor %}
  239.             {% endif %}
  240.             <div class="block-type12">      
  241.                 <div class="block-type12-ctn">          
  242.                     <div class="block-type12-left ">     
  243.                         <img src="{{ image_bg }}">
  244.                     </div> 
  245.                     
  246.                     <div class="block-type12-right "> 
  247.                         {% for product in block.products %}               
  248.                             {% include '@SyliusShop/Product/Box/_content-product4.html.twig' with {'product': product} only %}
  249.                             
  250.                         {% endfor %}
  251.                     </div>                 
  252.                 </div>    
  253.             </div>
  254.         {% endif %}
  255.         {# image uniquement #}
  256.         {% if block.typeblock == 13 %}
  257.             {% if null != block.images %}
  258.                 <div class="block-type13">      
  259.                     {% for image in block.images %}
  260.                         {% set image_bg = asset('/media/image/'~image.path) %}
  261.                                                 <a class="lien-type13" href=" {{ block.link }}">
  262.                             <img src="{{ image_bg }}">
  263.                                                 </a>
  264.                     {% endfor %}
  265.                 </div>
  266.             {% endif %}
  267.         {% endif %}
  268.         {# Collection - "Ces collections matchent !" #}
  269.         {% if block.typeblock == 14 %}
  270.             <div class="block-type14">             
  271.                 <div class="block-type14-ctn">              
  272.                     <div class="block-type14-top">
  273.                         <span>Associées ensemble,</span>
  274.                         <h3>Ces collections <strong>matchent</strong> !</h3>
  275.                     </div>
  276.                     {% if null != block.taxons %}
  277.                         <div class="block-type14-collections">
  278.                             <div class="block-type14-collections-ctn">
  279.                                 {% for taxon in block.taxons %}
  280.                                     {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock, 'id': taxon.id})) }}                                                                                                         
  281.                                 {% endfor %}
  282.                             </div>
  283.                         </div>
  284.                     {% endif %}
  285.                 </div>
  286.             </div>
  287.         {% endif %}
  288.         {# Bloc de taxon sans caroussel #}
  289.         {% if block.typeblock == 15 %}
  290.             
  291.             {% if null != block.taxons %}
  292.                 {% for taxon in block.taxons %}
  293.                     {# {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }} #}
  294.                     {% include '@SyliusShop/Webapic/page/listing-categories.html.twig' with {'taxon': taxon} only %}
  295.                     
  296.                 {% endfor %}
  297.             {% endif %}
  298.         {% endif %}
  299.         {# Bloc programme fidelité #}
  300.         {% if block.typeblock == 16 %}
  301.             
  302.             <div class="block-type16">
  303.                 {% set path = '' %}
  304.                 {% for image in block.images  %}
  305.                     {% set path = asset('/media/image/'~image.path) %}
  306.                             
  307.                 {% endfor %}
  308.                 <div class="block-type16-left">
  309.                     {% if null != path %}                            
  310.                         <img src="{{ path }}" class="ui image" />                            
  311.                     {% endif %}
  312.                 </div>
  313.                 <div class="block-type16-right">
  314.                     {{ block.content|raw}}
  315.                 </div>      
  316.             </div>           
  317.         {% endif %}
  318.         {# Bloc cadeau #}
  319.         {% if block.typeblock == 17 %}
  320.             <div class="block-type17">
  321.                 {% set path = '' %}
  322.             
  323.                 {% if null != block.images %}
  324.                     <div class="block-type17-left">    
  325.                         {% for image in block.images %}
  326.                             {% set image_bg = asset('/media/image/'~image.path) %}
  327.                             <img src="{{ image_bg }}">
  328.                         {% endfor %}
  329.                     </div>
  330.                 {% endif %}
  331.                 {% if null != block.taxons %}
  332.                     {% set taxonCode = '' %}
  333.                     <div class="block-type17-right">
  334.                         <div class="block-type17-right-ctn">           
  335.                             <div class="block-type17-right-top">    
  336.                             <ul>
  337.                                 {% for taxon in block.taxons %} 
  338.                                     {% for children in taxon.children %}    
  339.                                     <li>
  340.                                         <a href="">{{ children.name }}</a>               
  341.                                     </li>
  342.                                     {# {% set taxonCode = taxon.code %}
  343.                                     {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }} #}
  344.                                     {% endfor %}     
  345.                                 {% endfor %}  
  346.                             </ul>        
  347.                             </div>    
  348.                             <div class="block-type17-right-form">                 
  349.                                 <h1>{{ block.name|raw }} </h1>
  350.                                 {{ block.content|raw }}   
  351.                                 <form>
  352.                                     <ul class="top">
  353.                                         <li class="active">Pour</li>
  354.                                         <li>Budget</li>
  355.                                         <li>Qui aime</li>
  356.                                     </ul>
  357.                                     <ul class="bottom">
  358.                                         <li class="active">
  359.                                             {{ render(url('bitbag_render_block', {'code': taxonCode, 'typeblock': block.typeblock, 'select': 113, 'name': 'pour'})) }}
  360.                                         </li>
  361.                                         <li>
  362.                                             {{ render(url('bitbag_render_block', {'code': taxonCode, 'typeblock': block.typeblock, 'select': 126, 'name': 'budget'})) }}
  363.                                         </li>
  364.                                         <li>
  365.                                             {{ render(url('bitbag_render_block', {'code': taxonCode, 'typeblock': block.typeblock, 'select': 116, 'name': 'qui'})) }}
  366.                                         </li>
  367.                                     </ul>
  368.                                     <button data-url="{{ path('app_gift_submit') }}">Découvrir ma sélection <i class="check icon"></i></button>
  369.                                 </form> 
  370.                             </div>               
  371.                         </div>      
  372.                     </div>  
  373.                 {% endif %}    
  374.                 <div class="block-type17-bottom">    
  375.                 <h2>Ma sélection d’idées cadeaux <strong>sur mesure</strong>  !
  376.                 </div>
  377.             </div> 
  378.         
  379.         {% endif %}
  380.         {# Produits uniquement #}  
  381.         {% if block.typeblock == 18 and null != block.products %}
  382.             {% include '@SyliusShop/Webapic/listing/gift.html.twig' with {'products': block.products} %}
  383.         {% endif %}
  384.         {# idéées coutures #}  
  385.         {% if block.typeblock == 20 and null != block.taxons %}
  386.             {% include '@SyliusShop/Webapic/page/block-ideescouture.html.twig' with {'block': block} only %}
  387.         {% endif %}
  388.         {# collections - listing derniers collections #}  
  389.         {% if block.typeblock == 21  %}
  390.             {{ render(url('bitbag_render_block', {'typeblock': block.typeblock})) }}
  391.         {% endif %}
  392.         {# guide - sous menu #}  
  393.         {% if block.typeblock == 22 and null != block.taxons %}        
  394.             {% include '@SyliusShop/Webapic/page/block-sousmenu.html.twig' with {'block': block} only %}
  395.             
  396.         {% endif %}
  397.         {# guide - derniers articles #}  
  398.         {% if block.typeblock == 23 and null != block.taxons %}        
  399.             {# {% include '@SyliusShop/Webapic/page/block-derniersarticles.html.twig' with {'block': block} only %} #}
  400.             {% for taxon in block.taxons %} 
  401.                 <div class="categorie">
  402.                     {% include '@SyliusShop/Webapic/page/block-categorie-childrens.html.twig' with {'taxonsChilds': taxon.children} only %}
  403.                 </div>
  404.                 
  405.                 {{ render(url('bitbag_render_block', {'code': taxon.code, 'typeblock': block.typeblock})) }}
  406.                 
  407.             {% endfor %}  
  408.                 
  409.         {% endif %}
  410.         {% if block.typeblock == 24 %}        
  411.             <div class="banner-left" style="background-image: url({{ asset('webapic-theme/images/asupprimer/bg-accueil-banner.jpg') }})">
  412.                                         {% if not is_mobile() %}
  413.                                                 <div class="banner-left-img">
  414.                                                     <div id="circle">
  415.                                                             <img class="ui image lazyload" data-src="{{ asset('webapic-theme/images/txt-tournant-pensepour.svg') }}" /> 
  416.                                                     </div>
  417.                             </div>
  418.                                         {% endif %}
  419.                     <div class="banner-left-content" style="background-image: url({{ asset('webapic-theme/images/asupprimer/bg-accueil-banner.jpg') }})">
  420.                         <img class="ui image lazyload" data-src="{{ asset('webapic-theme/images/logo-vertical.svg') }}" />
  421.                         <h2>
  422.                             {{ block.name }}
  423.                             {# {{ 'app.front.accueil.banner.content1'|trans|raw }} #}
  424.                         </h2>
  425.                         <p>
  426.                             {# {{ block.content|raw }} #}
  427.                                                         {% if is_mobile() %}        
  428.                                                                 <div>
  429.                                                                         <input type="checkbox" id="expanded">
  430.                                                                         <div>{{ block.content|raw }}</div>
  431.                                                                         <label for="expanded" role="button">{{ 'app.front.global.btn_voirplus'|trans }}</label>
  432.                                                                 </div>
  433.                                                         {% else %}
  434.                                                                 <div>{{ block.content|raw }}</div>
  435.                                                         {% endif %}
  436.                             {# {{ 'app.front.accueil.banner.content2'|trans|raw }}
  437.                             {{ 'app.front.accueil.banner.content3'|trans|raw }} #}
  438.                         </p>
  439.                         {# <div class="lien-ctn">              
  440.                             <a class="lien-bleu" href=" {{ block.link }}">
  441.                             {{ 'app.ui.btn_ensavoirplus'|trans }}
  442.                             </a>
  443.                         </div> #}
  444.                                                 <div class="banner-bt">                
  445.                             {# {{ bitbag_cms_render_link_for_code('lamarque', { name: 'En savoir plus' }) }} #}
  446.                             
  447.                             <a href=" {{ block.link }}">
  448.                             {{ 'app.ui.btn_ensavoirplus'|trans }}
  449.                             </a>
  450.                         </div>
  451.                     </div>
  452.                 </div>
  453.         {% endif %}   
  454.         {% if block.typeblock == 0 %}
  455.         {% if null != block.name %}
  456.             <h2>{{ block.name }}</h2>
  457.             {% if null != block.taxons %}
  458.                 {% for taxon in block.taxons %}
  459.                     <p>Taxon: {{ taxon.slug }}</p>
  460.                     {# {{ dump(taxon) }} #}
  461.                     {# {{ render(url('bitbag_render_block', {'code': taxon.code})) }} #}
  462.                 {% endfor %}
  463.             {% endif %}
  464.             {% if null != block.products %}
  465.                 {% for product in block.products %}
  466.                     <p>Product: {{ product }}</p>
  467.                 {% endfor %}
  468.             {% endif %}
  469.         {% endif %}
  470.         {{ bitbag_cms_render_content(block) }}
  471.         {% endif %}
  472.     {% else %}
  473.         {% if null != block.name %}
  474.             <h2>{{ block.name }}</h2>
  475.             {% if null != block.taxons %}
  476.                 {% for taxon in block.taxons %}
  477.                     <p>Taxon: {{ taxon.slug }}</p>
  478.                     {# {{ dump(taxon) }} #}
  479.                     {# {{ render(url('bitbag_render_block', {'code': taxon.code})) }} #}
  480.                 {% endfor %}
  481.             {% endif %}
  482.             {% if null != block.products %}
  483.                 {% for product in block.products %}
  484.                     <p>Product: {{ product }}</p>
  485.                 {% endfor %}
  486.             {% endif %}
  487.         {% endif %}
  488.         {{ bitbag_cms_render_content(block) }}
  489.     {% endif %}
  490.   {% endif %}