templates/widget/gallery.html.twig line 1

Open in your IDE?
  1. <section class="std-section gallery">
        <div class="container">
            <div class="gallery__heading">
                <h2 class="h3">{{ title }}</h2>
            </div>
            <div class="gallery__container">
                {% if gallery is defined and gallery|length > 0 %}
                    {% for item in gallery %}
                        <div class="gallery__item">
                            <figure>
                                {% if item.image %}
                                    <img src="{{ asset('assets/front/img/empty.svg') }}" data-photoswipe="{{ item.image }}"
                                         data-src="{{ item.image }}" alt="{{ item.title|escape }}">
                                {% endif %}
                                <figcaption>{{ item.title }}</figcaption>
                            </figure>
                        </div>
                    {% endfor %}
                {% endif %}
            </div>
        </div>
        <script data-defer=".gallery">
            var requireOnDefer = function() {
                function callback() {
                    require(['assets/front/js/application/gallery']);
                    window.removeEventListener('.gallery', callback);
                }
                window.addEventListener('.gallery', callback);
            }
            requireOnDefer();
            require(['css!assets/front/css/application/gallery']);
        </script>
    </section>