templates/includes/blocks/block 2 zones.html.twig line 1

Open in your IDE?
  1. {% set displayOption = view.image.displayOption|default('top') %}
  2. {% set title = content.title|default %}
  3. {# we write the image into a variable to and then place it at the correct position depending on displayOption #}
  4. {% set image %}
  5.     {% set defaultFormat = '1380x' %}
  6.     {% set mobileFormat = '991x' %}
  7.     {% if displayOption in ['left', 'right'] %}
  8.         {% set defaultFormat = '400x' %}
  9.         {% set mobileFormat = '400x' %}
  10.     {% endif %}
  11.     <div class="block-image block-image__{{ displayOption }}">
  12.         {# @see https://github.com/sulu/web-twig/blob/v2.4.0/docs/image.md #}
  13.        {# {{ get_image(content.image|default, defaultFormat, {
  14.             '(max-width: 991px)': mobileFormat,
  15.         }) }}#}
  16.     </div>
  17. {% endset %}
  18. <div class="bloc-2zones block-{{content.type}} {{ content.class }}">
  19.     {% if content.titleG !=""  and  content.titleD =="" %}
  20.         <div class=" d-block d-md-none text-center px-3 show-br-mobile"><h2 class="title-big color-black-s line-h-100">{{ content.titleG }}</h2></div>
  21.         <div class="row  no-gutters">
  22.             <div class="col-md-6 col-12 order-md-2  wow fadeInRight" data-wow-duration="0.8s" data-wow-delay="0.2s">
  23.                 <div class="h-100  {{ content.classD }}">
  24.                     <div class=" object-fit-img w-100 h-100 position-relative text-right">
  25.                         {% if content.imageD %}
  26.                         <img src="{{content.imageD.url}}" alt="" class=""/>
  27.                         {% endif %}
  28.                     </div>
  29.                 </div>
  30.             </div>
  31.             <div class="col-md-6 col-12 pr-md-4 order-md-1 ">
  32.                 <div class="max-container-txt px-md-4 mr-md-0 mx-auto  position-relative bg-form-grey pb-lg-5 pt-md-0 pt-3  px-3 {{ content.classG }}">
  33.                     {% if content.titleG %}
  34.                         <h2 class="title-big color-black-s d-none d-md-block">{{ content.titleG }}</h2>
  35.                     {% endif %}
  36.                     {% if content.descriptionG %}
  37.                         <div class="pt-md-4 text-grey font-16">
  38.                             {{ content.descriptionG|raw }}
  39.                         </div>
  40.                     {% endif %}
  41.                 </div>
  42.             </div>
  43.         </div>
  44.     {% elseif content.titleG =="" and content.titleD =="" and content.descriptionG !="" and content.descriptionD !="" %}{# bloc 2 textes#}
  45.          <div class="max-container-2 px-lg-0 px-2  wow fadeInDown" data-wow-duration="0.8s" data-wow-delay="0.2s">
  46.             <div class="row mx-n2 mx-lg-n5 pt-md-4 pt-2">
  47.                 <div class="col-md-6 col-12 px-lg-5px-2 mb-lg-0 mb-3">
  48.                     <div class=" text-grey font-16 {{ content.classG }}">
  49.                         {% if content.descriptionG %}
  50.                             {{ content.descriptionG|raw }}
  51.                         {% endif %}
  52.                     </div>
  53.                 </div>
  54.                 <div class="col-md-6 col-12 px-lg-5 px-2 ">
  55.                     <div class=" text-grey font-16 {{ content.classD }}">
  56.                         {% if content.descriptionD %}
  57.                             {{ content.descriptionD|raw }}
  58.                         {% endif %}
  59.                     </div>
  60.                 </div>
  61.             </div>
  62.          </div>
  63.     {% elseif content.titleD !=""  and  content.titleG ==""  %}
  64.         <div class=" d-block d-md-none text-center px-3 show-br-mobile pb-2"><h2 class="title-big color-black-s line-h-100">{{ content.titleD }}</h2></div>
  65.          <div class="row  no-gutters">
  66.              <div class="col-md-6 col-12 pr-md-5  wow fadeInLeft" data-wow-duration="0.8s" data-wow-delay="0.2s">
  67.                 <div class="h-100  {{ content.classG }}">
  68.                     <div class=" object-fit-img w-not-100 h-100 position-relative text-right">
  69.                         {% if content.imageG %}
  70.                         <img src="{{content.imageG.url}}" alt="" class=""/>
  71.                         {% endif %} 
  72.                     </div>
  73.                     
  74.                 </div>
  75.             </div>
  76.             <div class="col-md-6 col-12">
  77.                 <div class="max-container-txt pl-md-0 ml-md-0 mx-auto position-relative bg-form-grey pb-lg-5 h-100 d-flex flex-column justify-content-center pt-md-0 pt-3  px-3 {{ content.classD }}">
  78.                     {% if content.titleD %}
  79.                         <h2 class="title-big color-black-s d-none d-md-block">{{ content.titleD }}</h2>
  80.                     {% endif %}
  81.                     {% if content.descriptionD %}
  82.                         <div class="pt-md-4 text-grey font-16">
  83.                             {{ content.descriptionD|raw }}
  84.                         </div>
  85.                     {% endif %}    
  86.                 </div>
  87.             </div>
  88.         </div>
  89.     {% endif %}
  90. </div>