templates/bundles/SyliusShopBundle/Product/Show/_images.html.twig line 1

  1. {% if product.imagesByType('main')is not empty %}
  2.     {% set source_path = product.imagesByType('main').first.path %}
  3.     {% set original_path = source_path | imagine_filter('sylius_shop_product_original') %}
  4.     {% set path = source_path | imagine_filter(filter | default('sylius_shop_product_large_thumbnail')) %}
  5. {% elseif product.images.first %}
  6.     {% set source_path = product.images.first.path %}
  7.     {% set original_path = source_path | imagine_filter('sylius_shop_product_original') %}
  8.     {% set path = source_path | imagine_filter(filter | default('sylius_shop_product_large_thumbnail')) %}
  9. {% else %}
  10.     {% set original_path = '//placehold.it/400x300' %}
  11.     {% set path = original_path %}
  12. {% endif %}
  13. {# <div data-product-image="{{ path }}" data-product-link="{{ original_path }}"></div>
  14. <a href="{{ original_path }}" class="ui fluid image" data-lightbox="sylius-product-image">
  15.     <img src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
  16. </a> #}
  17. {% if product.images | length >= 1 %}
  18.     <div class="bxslider">
  19.         {% for image in product.images %}
  20.             {% set path = image.path is not null? image.path | imagine_filter('sylius_shop_product_large_thumbnail') : '//placehold.it/400x300' %}
  21.             <div class="slider-content" style="border: 1px solid #e0e4e8; padding:5px; border-radius:5px;">
  22.                 <figure class="image-box">
  23.                     <a href="https://via.placeholder.com/600x600" class="lightbox-image" data-fancybox="gallery"><img src="{{ path }}" alt="{{ product.name }}"></a>
  24.                 </figure>
  25.                 <div class="slider-pager">
  26.                     <ul class="thumb-box">
  27.                         {% for image in product.images %}
  28.                             {% set path = image.path is not null? image.path | imagine_filter('sylius_shop_product_small_thumbnail') : '//placehold.it/200x200' %}
  29.                             <li>
  30.                                 <a class="{{loop.index == 1 ? 'active':'' }}" data-slide-index="{{loop.index -1 }}" href="#">
  31.                                     <figure><img src="{{ path }}" alt="{{ product.name }}" class="img-thumbnail"></figure>
  32.                                 </a>
  33.                                 {% if product.isConfigurable()and product.enabledVariants | length > 0 %}
  34.                                     {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  35.                                 {% endif %}
  36.                             </li>
  37.                         {% endfor %}
  38.                     </ul>
  39.                 </div>
  40.             </div>
  41.         {% endfor %}
  42.     </div>
  43. {% endif %}