custom/plugins/dupp_sync4_api/src/Resources/views/storefront/visual-order/visual-order.html.twig line 1

Open in your IDE?
  1. {% block sync4_content_visual_order %}
  2.     {% set absoluteBaseUrl = app.request.attributes.get('sw-sales-channel-absolute-base-url') %}
  3.     {% set baseUrl = app.request.attributes.get('sw-sales-channel-base-url') %}
  4.     {% set fullUrl = absoluteBaseUrl ~ baseUrl %}
  5.     <div class="visual-order is-{{ config('Sync4ApiExport.config.visualOrderLayout') }}">
  6.         {% set visualOrder = context.context.extensions.Sync4ApiExport.visualOrder %}
  7.         {% set explosionimages = visualOrder.explosionimages %}
  8.         {% for element in explosionimages %}
  9.             <div class="visual-order-element{% if visualOrder.hover is same as (true) %} is-hover{% endif %}">
  10.                 {% block sync4_content_visual_order_styles %}
  11.                     <style>
  12.                         {% for marker in element.markings %}
  13.                         #marker-{{ marker.id }} {
  14.                             top: {{ marker.top ~'%' }};
  15.                             left: {{ marker.left ~'%' }};
  16.                             height: {{ marker.height ~'%' }};
  17.                             width: {{ marker.width ~'%' }};
  18.                         }
  19.                         {% endfor %}
  20.                     </style>
  21.                 {% endblock %}
  22.                 {% block sync4_content_visual_order_image %}
  23.                     <div class="visual-order-image">
  24.                         {% set mediaId = element.source %}
  25.                         {% set mediaCollection = searchMedia([mediaId], context.context) %}
  26.                         {% set media = mediaCollection.get(mediaId) %}
  27.                         {% sw_thumbnails 'my-thumbnails' with {
  28.                             media: media,
  29.                             attributes: {
  30.                                 'title': "#{element.imagename}",
  31.                                 'alt': "#{element.imagename}"
  32.                             }
  33.                         } %}
  34.                     </div>
  35.                 {% endblock %}
  36.                 {% block sync4_content_visual_order_mapping %}
  37.                     <div class="visual-order-mapping">
  38.                         <ul class="mapping-list">
  39.                             {% for marker in element.markings %}
  40.                                 <li id="marker-{{ marker.id }}" class="marker">
  41.                                     {% if marker.type is same as ('Category') %}
  42.                                         {% set url = fullUrl ~ '/navigation/' ~ marker.link|join %}
  43.                                     {% elseif marker.type is same as ('Product') %}
  44.                                         {% if marker.link|length > 1 %}
  45.                                             {% set url = fullUrl ~ '/search?search=' ~ marker.link|join(',') %}
  46.                                         {% else %}
  47.                                             {% set url = seoUrl('frontend.detail.page', { 'productId': marker.link|join }) %}
  48.                                         {% endif %}
  49.                                     {% elseif marker.type is same as ('Url') %}
  50.                                         {% if marker.link|join starts with 'http' %}
  51.                                             {% set target = '_blank' %}
  52.                                             {% set url = marker.link|join %}
  53.                                         {% else %}
  54.                                             {% set url = fullUrl ~ marker.link|join %}
  55.                                         {% endif %}
  56.                                     {% endif %}
  57.                                     <a href="{{ url }}" class="marker-link"{% if target %} target="{{ target }}"{% endif %}></a>
  58.                                 </li>
  59.                             {% endfor %}
  60.                         </ul>
  61.                     </div>
  62.                 {% endblock %}
  63.             </div>
  64.         {% endfor %}
  65.     </div>
  66. {% endblock %}