{% set imageCount = block.images|length %}<section class="{{ imageCount > 3 ? 'overflow-hidden' : 'wysiwyg-area' }} content-block js-fade-in {{ styleModifier | default(null) }}"> {% if block.headline or block.description or block.buttons is not empty %} <div class="container-sm container mb-5"> {{ include('Includes/title-block.html.twig', { title: block.headline, isCentered: true }) }} {% if block.description %} <div class="wysiwyg-area__content wysiwyg"> {{ block.description|raw }} </div> {% endif %} {% if block.buttons is not empty %} <ul class="list-unstyled list-inline wysiwyg-area__buttons vertical-gutter--default"> {% for button in block.buttons %} {% if button['button']|default(false) and button['button'].data %} <li class="list-inline-item vertical-gutter__item"> <a href="{{ button['button'].data.href }}" target="{{ button['button'].data.target }}" title="{{ button['button'].data.title }}" class="btn btn-{{ button['buttonColor']|default(false) ? button['buttonColor'].data|default('primary-light') : 'primary-light' }}"> {{ button['button'].data.text }} </a> </li> {% endif %} {% endfor %} </ul> {% endif %} </div> {% endif %} {% if imageCount > 0 %} {% if imageCount <= 3 %} {% set thumb = 'wysiwyg-area' %} {% set embed = 'embed-responsive-9by5' %} {% set col = '12' %} {% set containerSize = 'sm' %} {% if imageCount >= 3 %} {% set thumb = 'wysiwyg-area--three-images' %} {% set embed = 'embed-responsive-1by1' %} {% set col = '4' %} {% set containerSize = 'md' %} {% elseif imageCount >= 2 %} {% set thumb = 'wysiwyg-area--two-images' %} {% set embed = 'embed-responsive-4by3' %} {% set col = '6' %} {% set containerSize = 'md' %} {% endif %} <div class="container container-{{ containerSize }} js-lightbox"> <div class="row"> {% for image in block.images %} <div class="col-{{ col }}"> {% do jsConfig().add('lightbox', true) %} {% set lightBoxSrc = image.thumbnail('lightbox') %} {% set description = getImageDescription(image) %} <figure class="wysiwyg-area__image wysiwyg-gallery-item"> <button class="wysiwyg-gallery__zoom-btn"> <span class="icon icon-expand" aria-hidden="true"></span> </button> <a href="{{ lightBoxSrc }}" data-sub-html="{{ description }}" class="js-lightbox__item wysiwyg-gallery-item__img-wrapper"> <div class="embed-responsive wysiwyg-area__image {{ embed }}"> {{ image.thumbnail(thumb).html({ imgAttributes: { class: 'js-lazy-img embed-responsive-item js-fade-in' }, lowQualityPlaceholder: true, })|raw }} {% do jsConfig().add('lazyImg', true) %} </div> </a> {% set description = getImageDescription(image) %} {% if description %} <figcaption> {{ description }} </figcaption> {% endif %} </figure> </div> {% endfor %} </div> </div> {% else %} <div class="tile-gallery__outer-wrapper"> <div class=""> <div class="tile-gallery js-lightbox {{ styleModifier | default(null) }}"> <div class="tile-gallery__container position-relative js-scrolling-row"> <div class="tile-gallery__wrapper row scrolling-row scrolling-row--invisible-scrollbar js-scrolling-row__row"> {% for image in block.images %} <div class="col-md-auto col-5 scrolling-row__item js-scrolling-row__item"> {% do jsConfig().add('lightbox', true) %} {% set lightBoxSrc = image.thumbnail('lightbox') %} <figure class="tile-gallery-item"> <button class="tile-gallery__zoom-btn"> <span class="icon icon-expand" aria-hidden="true"></span> </button> {% set description = getImageDescription(image) %} <a href="{{ lightBoxSrc }}" data-sub-html="{{ description }}" class="js-lightbox__item embed-responsive-1by1 embed-responsive tile-gallery-item__img-wrapper"> {{ image.thumbnail('tile-gallery-item').html({ imgAttributes: { class: 'js-lazy-img embed-responsive-item' }, lowQualityPlaceholder: true, }) | raw }} </a> {% if description %} <figcaption> {{ description }} </figcaption> {% endif %} </figure> </div> {% endfor %} </div> <div class="tile-gallery__navigation"> <button class="tile-gallery__btn tile-gallery__btn--prev js-scrolling-row__prev"><span class="icon icon-arrow-right" aria-label="Previous"></span></button> <button class="tile-gallery__btn tile-gallery__btn--next js-scrolling-row__next"><span class="icon icon-arrow-right" aria-label="Next"></span></button> </div> </div> </div> </div> </div> {% endif %} {% endif %}</section>