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

Open in your IDE?
  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 = asset('assets/shop/img/400x300.png') %}#}
  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="ui divider"></div> #}
  19.     {{ sylius_template_event('sylius.shop.product.show.before_thumbnails', {'product': product}) }}
  20.     <div id="gallery-right-images">
  21.         {% set imageCount = 0 %}
  22.         {% for image in product.images %}
  23.             {% if loop.index > 1 and imageCount < 4 %}
  24.                 {% set path = image.path is not null ? image.path|imagine_filter('sylius_shop_product_large_thumbnail') : asset('assets/shop/img/200x200.png') %}
  25.                 <div id="card-product-show-right">
  26.                     {% if product.isConfigurable() and product.enabledVariants|length > 0 %}
  27.                         {% include '@SyliusShop/Product/Show/_imageVariants.html.twig' %}
  28.                     {% endif %}
  29.                     <a href="{{ image.path|imagine_filter('sylius_shop_product_original') }}" data-lightbox="sylius-product-image">
  30.                         <img src="{{ path }}" data-large-thumbnail="{{ image.path|imagine_filter('sylius_shop_product_large_thumbnail') }}" alt="{{ product.name }}" />
  31.                     </a>
  32.                 </div>
  33.                 {% set imageCount = imageCount + 1 %}
  34.             {% endif %}
  35.         {% endfor %}
  36.     </div>
  37. {% endif %}
  38. <style>
  39.     /*#card-product-show-right {*/
  40.     /*    width: calc(50% - 1rem);*/
  41.     /*}*/
  42.     /*#card-product-show-right img {*/
  43.     /*    width: 100% ;*/
  44.     /*    height: 100%;*/
  45.     /*}*/
  46.     /*#card-product-show-right a{*/
  47.     /*    display: block;*/
  48.     /*    width: 100%;*/
  49.     /*    height: 100%;*/
  50.     /*}*/
  51.     /*#gallery-right-images{*/
  52.     /*    display: inline-flex;*/
  53.     /*    flex-wrap: wrap;*/
  54.     /*    gap: 1rem;*/
  55.     /*}*/
  56. </style>