{# Gallery ======= Creates a gallery object in two different layouts. The simple layout lays the images together, the smart layout tries to arrange the images in the photogrid. Pictures can be enlarged on click. You can also use the gallery for individual images. @param {string} name = Classname @param {object} data = Galleryentries @param {object} data.photo = Image @param {string} data.caption = Optional Caption @param {object} options = Optionsobject @param {string} options.layoutType = Arrangement of the gallery [smart, simple] @param {string} options.ratio = Optional adjustable ratio (for `simple` Gallery) @param {string} options.width = Optional Width (for `simple` Gallery) #} {% set thumbWidth = ' ' %} {% set flexOverwrite = '' %} {% set layout = ' c-gallery--l-'~options.layoutType %} {# Get Gallery Count #} {% set galleryCount = data.total() %} {% set galCountMode = galleryCount > 1 ? ' c-gallery--moreimages' : '' %} {# Setup for the Simple Layout #} {% if options.layoutType == 'simple' %} {% set galCountNr = '' %} {# Setup the Width #} {% set thumbWidth = options.width ? ' style=width:'~options.width~' ' %} {% set flexOverwrite = options.width ? ' c-gallery--noFlex' %} {# Define Crop #} {% if options.ratio %} {% set crop = options.ratio %} {% else %} {% set crop = galleryCount > 1 ? '1:1' : 'nocrop' %} {% endif %} {# Setup for the Smartlayout #} {% elseif options.layoutType == 'smart' %} {# Gallery Count Mode #} {% set galCountNr = galleryCount < 10 ? ' c-gallery--'~galleryCount : ' c-gallery--unlimited' %} {# Define Crop #} {% set crop = galleryCount > 1 ? '1:1' : 'nocrop' %} {% endif %} {# Build Element Block #}
{% for gallery in data %} {% endfor %}
{# Root element of PhotoSwipe. Must have class pswp. #}