templates/blocks/framework_content_image.html.twig line 1

Open in your IDE?
  1. {#
  2.     {
  3.         "key": "framework_content_image",
  4.         "category": "Framework",
  5.         "label": "Content + afbeelding",
  6.         "description": "Content met afbeelding",
  7.         "allowMove": true,
  8.         "blocks": [
  9.             {
  10.                 "key": "block-0",
  11.                 "size": 6,
  12.                 "buttons": true,
  13.                 "required": "none",
  14.                 "fields": [
  15.                     {
  16.                         "key": "title",
  17.                         "type": "text",
  18.                         "label": "Titel"
  19.                     },
  20.                     {
  21.                         "key": "text",
  22.                         "type": "textarea",
  23.                         "label": "Tekst"
  24.                     }
  25.                 ]
  26.             },
  27.             {
  28.                 "key": "block-1",
  29.                 "size": 6,
  30.                 "required": "media",
  31.                 "fields": []
  32.             }
  33.         ]
  34.     }
  35. #}
  36. {#
  37.     Available objects:
  38.     - page: current page
  39.     - locale: current locale
  40.     - wrapper: contains the wrapper around multiple blocks.
  41.     - firstBlock: contains the first block in the wrapper, useful when only one block is expected.
  42.     - data: contains the data as mentioned above this file
  43. #}
  44. <section
  45. class="text-blocks {{wrapper.classList}}"
  46. id="{{wrapper.cssId is defined ? wrapper.cssId : ''}}"
  47. style="{{wrapper.styleList}}"
  48. data-id="{{wrapper.id}}">
  49.   <div class="container">
  50.     {% if wrapper.label or wrapper.intro is not empty %}
  51.       <div class="introblock">
  52.         {% if wrapper.label is not empty %}
  53.           <div class="introtitle">
  54.             {{wrapper.label|raw}}
  55.           </div>
  56.         {% endif %}
  57.         {% if wrapper.intro is not empty %}
  58.           <div class="introtext">
  59.             {{wrapper.intro|raw}}
  60.           </div>
  61.         {% endif %}
  62.       </div>
  63.     {% endif %}
  64.     <div class="section-bg">
  65.       <div class="row">
  66.         {% for b in wrapper.blocks %}
  67.           {% if data.blocks_q[b.templateKey].required == 'media' %}
  68.             <div class="col-sm-12 col-md-12 col-lg-{{b.width}} {{b.offset('offset-lg-')}} {{b.config.class}}" id="{{b.config.id}}">
  69.               {% if b.media is not empty %}
  70.                 <div class="lcp">
  71.                   {% if b.media.hasBlurred %}
  72.                     <picture>
  73.                       {% if b.media.hasWebp() %}
  74.                         <source srcset="/{{b.media.getBlurredWebpPath('medium')}}" type="image/webp">
  75.                       {% endif %}
  76.                       <source srcset="/{{b.media.getBlurredWebPath('medium')}}" type="{{b.media.mime}}">
  77.                       <img class="lq" alt="{{b.media.description_alt}}" src="/{{b.media.getBlurredWebPath('medium')}}" type="{{b.media.mime}}" loading="lazy" width="{{b.media.width}}" height="{{b.media.height}}">
  78.                     </picture>
  79.                   {% endif %}
  80.                   <picture>
  81.                     {% if b.media.hasWebp() %}
  82.                       <source srcset="/{{b.media.getWebpPath('large')}}" type="image/webp">
  83.                     {% endif %}
  84.                     <source srcset="/{{b.media.getWebPath('large')}}" type="{{ b.media.mime }}">
  85.                   <img class="hq" alt="{{b.media.description_alt}}" src="/{{b.media.getWebPath('large')}}" type="{{b.media.mime}}" loading="lazy" width="{{b.media.width}}" height="{{b.media.height}}" onload="this.style.opacity=1{% if b.media.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  86.                   </picture>
  87.                 </div>
  88.               {% endif %}
  89.             </div>
  90.             
  91.           {% else %}
  92.             <div class="col-sm-12 col-md-12 col-lg-{{b.width}} {{b.offset('offset-lg-')}} {{b.config.class}}" id="{{b.config.id}}">
  93.             </div>
  94.             
  95.           {% endif %}
  96.         {% endfor %}
  97.       </div>
  98.     </div>
  99.     <div class="section-front">
  100.       <div class="row">
  101.         {% for b in wrapper.blocks %}
  102.           {% if data.blocks_q[b.templateKey].required == 'media' %}
  103.             <div class="col-sm-12 col-md-12 col-lg-{{b.width}} {{b.offset('offset-lg-')}} {{b.config.class}}" id="{{b.config.id}}">
  104.               <div class="image-wrapper">
  105.                 {% if b.media is not empty %}
  106.                   <div class="lcp">
  107.                     {% if b.media.hasBlurred %}
  108.                       <picture>
  109.                         {% if b.media.hasWebp() %}
  110.                           <source srcset="/{{b.media.getBlurredWebpPath('medium')}}" type="image/webp">
  111.                         {% endif %}
  112.                         <source srcset="/{{b.media.getBlurredWebPath('medium')}}" type="{{b.media.mime}}">
  113.                         <img class="lq" alt="{{b.media.description_alt}}" src="/{{b.media.getBlurredWebPath('medium')}}" type="{{b.media.mime}}" loading="lazy" width="{{b.media.width}}" height="{{b.media.height}}">
  114.                       </picture>
  115.                     {% endif %}
  116.                     <picture>
  117.                       {% if b.media.hasWebp() %}
  118.                         <source srcset="/{{b.media.getWebpPath('large')}}" type="image/webp">
  119.                       {% endif %}
  120.                       <source srcset="/{{b.media.getWebPath('large')}}" type="{{ b.media.mime }}">
  121.                     <img class="hq" alt="{{b.media.description_alt}}" src="/{{b.media.getWebPath('large')}}" type="{{b.media.mime}}" loading="lazy" width="{{b.media.width}}" height="{{b.media.height}}" onload="this.style.opacity=1{% if b.media.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  122.                     </picture>
  123.                   </div>
  124.                 {% endif %}
  125.               </div>
  126.             </div>
  127.             
  128.           {% else %}
  129.             <div class="col-sm-12 col-md-12 col-lg-{{b.width}} {{b.offset('offset-lg-')}} {{b.config.class}}" id="{{b.config.id}}">
  130.               <div class="text-wrapper">
  131.                 <div class="padder">
  132.                   {% if b.config.title is not empty %}
  133.                     <h3 class="title">{{b.config.title}}</h3>
  134.                   {% endif %}
  135.                   <div class="text">
  136.                     {{b.config.text|raw}}
  137.                   </div>
  138.                   {% if b.config.buttons is defined %}
  139.                     {% for button in b.config.buttons %}
  140.                       <a href="{{button.url}}" {% if button.target is defined and button.target != 'null' and button.target is not empty %} target="{{button.target}}" {% endif %} class="btn {{button.class}}">
  141.                         {{button.label}}
  142.                         <i class="fa fa-arrow-right"></i>
  143.                       </a>
  144.                     {% endfor %}
  145.                   {% endif %}
  146.                 </div>
  147.               </div>
  148.             </div>
  149.             
  150.           {% endif %}
  151.         {% endfor %}
  152.       </div>
  153.     </div>
  154.   </div>
  155. </section>