drowl_paragraphs_bs-1.x-dev/modules/drowl_paragraphs_bs_type_gallery/templates/paragraph--drowl-paragraphs-bs--gallery.html.twig

modules/drowl_paragraphs_bs_type_gallery/templates/paragraph--drowl-paragraphs-bs--gallery.html.twig
{% extends "@drowl_paragraphs_bs/paragraph--drowl-paragraphs-bs.html.twig" %}

{% block content %}
    {%
      set gallery_classes = [
        'gallery-grid',
        paragraph.field_image_zoomable.value ? 'photoswipe-gallery'
      ]
    %}
    {{ attach_photoswipe() }}
    <div{{ gallery_attributes.addClass(gallery_classes) }}>
      {% for key, item in content.field_gallery['#items'] %}
        <div class="gallery-grid__item">
          {#
            We had cases, where empty items existed here, resulted in an empty field__item tag,
            so we need to check for empty here.
          #}
          <div {{ image_wrapper_attributes.addClass('image-wrapper') }}>
            {% if item.target_id %}
              {{ include('@drowl_paragraphs_bs/inc/flexible_image.html.twig', {
                image_field: drupal_field('field_media_image', 'media', item.target_id),
                image_is_zoomable: paragraph.field_image_zoomable.value,
                responsive_image_size: paragraph.field_resp_imagestyle.value.0.target_id|default('page_width_scale')
              }) }}
            {% endif %}
          </div>
        </div>
      {% endfor %}
    </div>
{% endblock %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc