src/CmsBundle/Resources/views/blocks/framework_hero_video.html.twig line 1

Open in your IDE?
  1. {#
  2.     {
  3.         "key": "framework_hero_video",
  4.         "category": "Framework",
  5.         "label": "Hero (Video)",
  6.         "description": "...",
  7.         "allowMove": false,
  8.         "blocks": [
  9.             {
  10.                 "key": "block-0",
  11.                 "size": 12,
  12.                 "required": "none",
  13.                 "buttons": true,
  14.                 "fields": [
  15.                     {
  16.                         "key": "title",
  17.                         "type": "text",
  18.                         "label": "Titel"
  19.                     },
  20.                     {
  21.                         "key": "content",
  22.                         "type": "textarea",
  23.                         "label": "Content"
  24.                     },
  25.                     {
  26.                         "key": "video",
  27.                         "type": "text",
  28.                         "label": "Video URL (link naar bestand vanuit media-bibliotheek)"
  29.                     }
  30.                 ]
  31.             },
  32.             {
  33.                 "key": "block-1",
  34.                 "size": 12,
  35.                 "required": "media",
  36.                 "fields": []
  37.             }
  38.         ]
  39.     }
  40. #}
  41. <section
  42. class="hero video {{wrapper.classList}}"
  43. id="{{wrapper.cssId is defined ? wrapper.cssId : ''}}"
  44. style="{{wrapper.styleList}}"
  45. data-id="{{wrapper.id}}">
  46.   <div class="videowrapper">
  47.     <div class="videocontainer">
  48.       {% if wrapper.blocks[1].media is not empty %}
  49.         <div class="lcp lcp-bg">
  50.           {% if wrapper.blocks[1].media.hasBlurred %}
  51.             <picture>
  52.               {% if wrapper.blocks[1].media.hasWebp() %}
  53.                 <source srcset="/{{wrapper.blocks[1].media.getBlurredWebpPath('large')}}" type="image/webp">
  54.               {% endif %}
  55.               <source srcset="/{{wrapper.blocks[1].media.getBlurredWebPath('large')}}" type="{{wrapper.blocks[1].media.mime}}">
  56.               <img class="lq" alt="{{wrapper.blocks[1].media.description_alt}}" src="/{{wrapper.blocks[1].media.getBlurredWebPath('large')}}" type="{{wrapper.blocks[1].media.mime}}" loading="lazy" width="{{wrapper.blocks[1].media.width}}" height="{{wrapper.blocks[1].media.height}}">
  57.             </picture>
  58.           {% endif %}
  59.           <picture>
  60.             {% if wrapper.blocks[1].media.hasWebp() %}
  61.               <source srcset="/{{wrapper.blocks[1].media.getWebpPath('full')}}" type="image/webp">
  62.             {% endif %}
  63.             <source srcset="/{{wrapper.blocks[1].media.getWebPath('full')}}" type="{{ wrapper.blocks[1].media.mime }}">
  64.           <img class="hq" alt="{{wrapper.blocks[1].media.description_alt}}" src="/{{wrapper.blocks[1].media.getWebPath('full')}}" type="{{wrapper.blocks[1].media.mime}}" loading="lazy" width="{{wrapper.blocks[1].media.width}}" height="{{wrapper.blocks[1].media.height}}" onload="this.style.opacity=1{% if wrapper.blocks[1].media.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  65.           </picture>
  66.         </div>
  67.       {% endif %}
  68.       {% if firstBlock.config.video is not empty %}
  69.         <video playsinline="playsinline" muted="muted" loop="" autoplay="true" type="video/mp4" data-radium="true" {% if wrapper.blocks[1].media %} poster="" {% endif %}>
  70.           <source src="{{firstBlock.config.video}}" type="video/mp4">
  71.         </video>
  72.       {% endif %}
  73.     </div>
  74.     <div class="titles">
  75.       <div class="vwrapper">
  76.         <div class="valign">
  77.           <div class="container {{ firstBlock.class }}">
  78.             <h1>{{firstBlock.config.title}}</h1>
  79.             {% if firstBlock.config.content is not empty %}
  80.               <div class="text">
  81.                 {{firstBlock.config.content|raw}}
  82.               </div>
  83.             {% endif %}
  84.             {% for b in wrapper.blocks %}
  85.               {% if b.config.buttons is defined %}
  86.                 <div class="btns">
  87.                 {% for button in b.config.buttons %}
  88.                   <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}}">
  89.                     {{button.label}}
  90.                     <i class="fa fa-arrow-right"></i>
  91.                   </a>
  92.                 {% endfor %}
  93.                 </div>
  94.               {% endif %}
  95.             {% endfor %}
  96.           </div>
  97.         </div>
  98.       </div>
  99.     </div>
  100.   </div>
  101. </section>