templates/PageParts/FolderGalleryPagePart/view.html.twig line 1

Open in your IDE?
  1. <section class="content">
  2.     {% if (resource.getMedia | length > 1) %}
  3.         <div class="gallery" id="gallery-{{ resource.id }}">
  4.             <div class="gallery-boxes">
  5.                 {% for media in resource.getMedia %}
  6.                     {% if ( media and media.contentType != "application/octet-stream") %}
  7.                         <div class="gallery-box">
  8.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 1400, q: 80, fit: 'max' }) %}
  9.                             {% set fullSrcUrl = croppedImgSrc(media.url, null, { w: 1920, q: 80 }) %}
  10.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  11.                             <a href="{{ asset(fullSrcUrl) }}"
  12.                                data-gallery-id="{{ resource.id }}" data-gallery-slide="{{ media.id }}">
  13.                                 <img class="lazy" src="{{ previewSrc }}" data-src="{{ imgUrl }}"
  14.                                      alt="{{ 'gallery.image_alt' | trans }}" />
  15.                             </a>
  16.                         </div>
  17.                     {% endif %}
  18.                 {% endfor %}
  19.             </div>
  20.             <div class="gallery-nav">
  21.                 {% for media in resource.getMedia %}
  22.                     {% if ( media and media.contentType != "application/octet-stream") %}
  23.                         <div class="gallery-thumb">
  24.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 180, q: 80, fit: 'crop' }) %}
  25.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  26.                             <img class="lazy" src="{{ previewSrc }}" data-src="{{ imgUrl }}"
  27.                                  alt="{{ 'gallery.image_alt' | trans }}" />
  28.                         </div>
  29.                     {% endif %}
  30.                 {% endfor %}
  31.             </div>
  32.             <div class="gallery-clearfix"></div>
  33.         </div>
  34.         <div class="gallery fullscreen" id="gallery-fullscreen-{{ resource.id }}">
  35.             <div class="gallery-boxes">
  36.                 {% for media in resource.getMedia %}
  37.                     {% if ( media and media.contentType != "application/octet-stream") %}
  38.                         <div class="gallery-box">
  39.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 1920, q: 80, fit: 'max' }) %}
  40.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  41.                             <a href="{{ asset(imgUrl) }}"
  42.                                data-gallery-id="{{ resource.id }}" data-gallery-slide="{{ media.id }}">
  43.                                 <img class="lazy" src="{{ previewSrc }}" data-src="{{ imgUrl }}"
  44.                                      alt="{{ 'gallery.image_alt' | trans }}" />
  45.                             </a>
  46.                         </div>
  47.                     {% endif %}
  48.                 {% endfor %}
  49.             </div>
  50.             <div class="gallery-nav">
  51.                 {% for media in resource.getMedia %}
  52.                     {% if ( media and media.contentType != "application/octet-stream") %}
  53.                         <div class="gallery-thumb">
  54.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 180, q: 80, fit: 'crop' }) %}
  55.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  56.                             <img class="lazy" src="{{ previewSrc }}" data-src="{{ imgUrl }}"
  57.                                  alt="{{ 'gallery.image_alt' | trans }}" />
  58.                         </div>
  59.                     {% endif %}
  60.                 {% endfor %}
  61.             </div>
  62.             <div class="gallery-clearfix"></div>
  63.             <div class="gallery-close"><i class="fas fa-times"></i></div>
  64.             <div class="gallery-caption">
  65.             </div>
  66.         </div>
  67.     {% else %}
  68.         <div class="gallery" id="gallery-{{ resource.id }}">
  69.             <div class="gallery-boxes">
  70.                 {% for media in resource.getMedia %}
  71.                     {% if ( media and media.contentType != "application/octet-stream") %}
  72.                         <div class="gallery-box">
  73.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 1400, q: 80, fit: 'max' }) %}
  74.                             {% set fullSrcUrl = croppedImgSrc(media.url, null, { w: 1920, q: 80 }) %}
  75.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  76.                             <a href="{{ asset(fullSrcUrl) }}"
  77.                                data-gallery-id="{{ resource.id }}" data-gallery-slide="{{ media.id }}">
  78.                                 <img class="lazy" src="{{ previewSrc }}" data-src="{{ imgUrl }}"
  79.                                      alt="{{ 'gallery.image_alt' | trans }}" />
  80.                             </a>
  81.                         </div>
  82.                     {% endif %}
  83.                 {% endfor %}
  84.             </div>
  85.         </div>
  86.         <div class="gallery fullscreen" id="gallery-fullscreen-{{ resource.id }}">
  87.             <div class="gallery-boxes">
  88.                 {% for media in resource.getMedia %}
  89.                     {% if ( media and media.contentType != "application/octet-stream") %}
  90.                         <div class="gallery-box">
  91.                             {% set imgUrl = croppedImgSrc(media.url, null, { w: 1920, q: 80, fit: 'max' }) %}
  92.                             {% set previewSrc = croppedImgSrc(media.url, null, { w: 75, h: 60, q: 50, blur: 20, fit: 'crop' }) %}
  93.                             <a href="{{ asset(imgUrl) }}"
  94.                                data-gallery-id="{{ resource.id }}" data-gallery-slide="{{ media.id }}">
  95.                                 <img class="lazy" src="previewSrc" data-src="{{ imgUrl }}"
  96.                                      alt="{{ 'gallery.image_alt' | trans }}" />
  97.                             </a>
  98.                         </div>
  99.                     {% endif %}
  100.                 {% endfor %}
  101.             </div>
  102.             <div class="gallery-clearfix"></div>
  103.             <div class="gallery-close"><i class="fas fa-times"></i></div>
  104.             <div class="gallery-caption">
  105.             </div>
  106.         </div>
  107.     {% endif %}
  108. </section>