templates/blocks/framework_content_image.html.twig line 1

Open in your IDE?
  1. {#
  2.     {
  3.         "key": "framework_content_image",
  4.         "category": "02. Content",
  5.         "label": "02.03 Content with image",
  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 id="{{wrapper.cssId is defined ? wrapper.cssId : ''}}" class="text-blocks {{wrapper.cssClass is defined ? wrapper.cssClass : ''}}">
  45.   <div class="container">
  46.     {% if wrapper.label or wrapper.intro is not empty %}
  47.       <div class="introblock">
  48.         {% if wrapper.label is not empty %}
  49.           <div class="introtitle">
  50.             {{wrapper.label|raw}}
  51.           </div>
  52.         {% endif %}
  53.         {% if wrapper.intro is not empty %}
  54.           <div class="introtext">
  55.             {{wrapper.intro|raw}}
  56.           </div>
  57.         {% endif %}
  58.       </div>
  59.     {% endif %}
  60.     <div class="row d-flex align-items-center">
  61.       {# WALK THROUGH EVERY BLOCK #}
  62.       {% for b in wrapper.blocks %}
  63.         {# FIND TYPE BY REQUIRED INPUT FOR BLOCK #}
  64.         {% if data.blocks_q[b.templateKey].required == 'media' %}
  65.           {# FOUND MEDIA BLOCK #}
  66.           <div class="col-sm-12 col-lg-6 h-100 image-block order-0 order-lg-1" style="background: url(/{{b.media.getWebPath}}) no-repeat center; background-size: cover;">
  67.             <img src="/{{b.media.getWebPath}}" alt="">
  68.           </div>
  69.         {% else %}
  70.           {# NO MEDIA BLOCK, MUST BE TEXT BLOCK #}
  71.           <div class="col-sm-12 col-lg-6 order-1 order-lg-0">
  72.             <div class="padder">
  73.               {% if b.config.title is not empty %}
  74.                 <h3 class="title">{{b.config.title}}</h3>
  75.               {% endif %}
  76.               <p>
  77.                 {{b.config.text|raw}}
  78.               </p>
  79.               {% if b.config.buttons is defined %}
  80.                 {% for button in b.config.buttons %}
  81.                   <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}}">
  82.                     {{button.label}}
  83.                     <i class="fa fa-angle-right"></i>
  84.                   </a>
  85.                 {% endfor %}
  86.               {% endif %}
  87.             </div>
  88.           </div>
  89.         {% endif %}
  90.       {% endfor %}
  91.     </div>
  92.   </div>
  93. </section>