Skip to content

mixin gallery.twig

Aleksey Ilyin edited this page Aug 11, 2021 · 3 revisions

Uses OwlCarousel, Fancybox and connect him. Require jQuery

Params

  • images - collection or array with image urls
  • owlcarousel - boolean (default true)
  • owlcarousel_opt - json text with params
  • fancybox - boolean (default true)
  • fancybox_opt - json text with params

Example

{% include 'mixin/gallery.twig' with {
    'owlcarousel': true,
    'owlcarousel_opt': "{loop: true, dots: false, margin: 40, autoplay: true, nav:false, responsive: {0: {items: 1}, 768: {items: 2}, 991: {items: 3}}}",
    'fancybox': true,
    'fancybox_opt': "{buttons: ['zoom', 'share', 'slideShow', 'fullScreen', 'download', 'thumbs', 'close'], protect: true, preventCaptionOverlap: true}",
    'images': [
        'https://...',
        'https://...',
        'https://...',
        'https://...',
        'https://...',
        'https://...',
    ]
} %}

SRC

/src/Template/mixin/gallery.twig

Clone this wiki locally