{% set randomId = 'swiper_' ~ random() %}<div class="row news_row"> <div class="col news_col"> {% if content.getShowType == "imageSliders" %} <div id="gallery-content"> <div class="news-gallery-row" > {% set imgmain = null %} {% set imgtop = [] %} {% set imgbottom = [] %} {% set i = 0 %} {% for image in content.gallery() %} {% if i == 0 %} {% set imgmain = image %} {% elseif i % 2 == 0 %} {% set imgtop = imgtop|merge([image]) %} {% else %} {% set imgbottom = imgbottom|merge([image]) %} {% endif %} {% set i = i + 1 %} {% endfor %} {% if imgtop %} <div id="{{content.getIndex()}}-top" class="news-gallery-side-image"> {% for image in imgtop %} <a href="{{ image.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> {{ image.thumbnail('seiko_newsGallerySmallSliderImage').getHtml({ 'imgAttributes': { 'class': '', 'height': '150px' } }) | raw }} </a> {% endfor %} </div> {% endif %} <div class="col news-gallery-main-image d-none d-sm-block"> <a href="{{ imgmain.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> {{ imgmain.thumbnail('seiko_newsGalleryBigSliderImage').getHtml({ 'imgAttributes': { 'class': 'img-fluid', 'height': '250px' } }) | raw }} </a> </div> <div class="col news-gallery-main-image d-block d-sm-none"> <a href="{{ imgmain.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> {{ imgmain.thumbnail('seiko_newsGalleryBigSliderImage').getHtml({ 'imgAttributes': { 'class': 'img-fluid'} }) | raw }} </a> </div> {% if imgbottom %} <div id="{{content.getIndex()}}-bottom" class="news-gallery-side-image"> {% for image in imgbottom %} <a href="{{ image.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> {{ image.thumbnail('seiko_newsGallerySmallSliderImage').getHtml({ 'imgAttributes': { 'class': '', 'height': '150px' } }) | raw }} </a> {% endfor %} </div> {% endif %} </div> </div> {% endif %} {% if content.getShowType == "allimage" %} <div class="all-image-gallery"> {% for image in content.gallery() %} <a href="{{ image.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> {{ image.thumbnail().getHtml({ 'imgAttributes': { 'class': 'img-fluid all-image' } }) | raw }} </a> {% endfor %} </div> {% endif %} {% if content.getShowType == "singleimage" %} {% for image in content.gallery() %} <a class="{{content.getIndex()}}-single-image single-image" href = "{{ image.getImage().fullPath }}" data-fancybox="{{content.getIndex()}}_gallery"> <div style="position: relative; display: inline-block;"> {{ image.getImage().getThumbnail().getHtml({ 'imgAttributes': { 'class' : 'img-fluid', } }) | raw }} <img class="zoom-icon" src="{{ asset('/themes/frontend/images/fancyzoomicon.png') }}" alt="Nagyítás"> </div> </a> {% endfor %} {% endif %} </div></div> {% block scripts %} {% do pimcore_head_script().appendFile(asset('themes/frontend/vendors/lightbox/js/lightbox.js')) %} {% do pimcore_head_script().appendFile('https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js') %} <script> content_type = "{{content.getShowType}}"; if(content_type == "imageSliders"){ let content = document.getElementById("gallery-content"); let top = document.getElementById("{{content.getIndex()}}-top"); let bottom = document.getElementById("{{content.getIndex()}}-bottom"); if(bottom != null && bottom.scrollWidth == bottom.clientWidth){ bottom.style.justifyContent = "center"; } if(top != null && top.scrollWidth == top.clientWidth){ top.style.justifyContent = "center"; } } if(content_type == "singleimage"){ let content = document.getElementsByClassName("{{content.getIndex()}}-single-image"); if(content != null){ content[0].style.display = "flex"; } } </script>{% endblock %}{% block head_stylesheets %} {% do pimcore_head_link().appendStylesheet(asset('themes/frontend/vendors/lightbox/css/lightbox.css')) %} {% do pimcore_head_link().appendStylesheet('https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css') %}{% endblock %}