vendor/store.shopware.com/moorlfoundation/src/Resources/views/plugin/moorl-foundation/listing-item.html.twig line 1

Open in your IDE?
  1. {% if not schemaOrgType %}
  2.     {% set schemaOrgType = 'Thing' %}
  3. {% endif %}
  4. {% set itemContent %}
  5.     {% block moorl_foundation_listing_item %}
  6.         {% if config.listingLayout.value == 'search-suggest' %}
  7.             {# Clone of "storefront/layout/header/search-suggest.html.twig" #}
  8.             {% block moorl_listing_search_suggest_item %}
  9.                 <li class="search-suggest-product js-result">
  10.                     <a href="{{ url }}"
  11.                        title="{{ title }}"
  12.                        class="search-suggest-product-link">
  13.                         <div class="row align-items-center {{ gridNoGuttersClass }}">
  14.                             <div class="col-auto search-suggest-product-image-container">
  15.                                 {% if media.url %}
  16.                                     {% sw_thumbnails 'search-suggest-product-image-thumbnails' with {
  17.                                         media: media,
  18.                                         sizes: {
  19.                                             'default': '100px'
  20.                                         },
  21.                                         attributes: {
  22.                                             'class': 'search-suggest-product-image',
  23.                                             'alt': (media.translated.alt ?: ''),
  24.                                             'title': (media.translated.title ?: '')
  25.                                         }
  26.                                     } %}
  27.                                 {% else %}
  28.                                     {% sw_icon 'placeholder' style {
  29.                                         'size': 'lg'
  30.                                     } %}
  31.                                 {% endif %}
  32.                             </div>
  33.                             <div class="col search-suggest-product-name">
  34.                                 {{ title }}
  35.                             </div>
  36.                             <div class="col-auto text-muted">
  37.                                 {{ meta }}
  38.                             </div>
  39.                         </div>
  40.                     </a>
  41.                 </li>
  42.             {% endblock %}
  43.         {% else %}
  44.             <div class="moorl-listing-item-image">
  45.                 {% block moorl_listing_item_image %}
  46.                     {% if media.url %}
  47.                         {% set imageCss = [] %}
  48.                         {% if config.itemLayout.value == 'avatar' %}
  49.                             {% set imageCss = imageCss|merge([
  50.                                 "height:#{config.itemWidth.value}",
  51.                                 "width:#{config.itemWidth.value}",
  52.                             ]) %}
  53.                         {% endif %}
  54.                         {% sw_thumbnails 'moorl-listing-item-image-thumbnails' with {
  55.                             media: media,
  56.                             attributes: {
  57.                                 'itemprop': 'image',
  58.                                 'alt': title,
  59.                                 'class': "is-#{config.displayMode.value}",
  60.                                 'style': imageCss|join(';'),
  61.                                 'title': ''
  62.                             }
  63.                         } %}
  64.                     {% elseif config.itemLayout.value == 'image-or-title' %}
  65.                         <div itemprop="name" class="moorl-listing-item-title" title="{{ title }}">
  66.                             {{ title|raw }}
  67.                         </div>
  68.                     {% else %}
  69.                         {% sw_icon 'placeholder' style {
  70.                             'size': 'fluid'
  71.                         } %}
  72.                     {% endif %}
  73.                 {% endblock %}
  74.             </div>
  75.             {% if config.itemLayout.value != 'image-or-title' %}
  76.                 <div class="moorl-listing-item-content" style="{{ contentCss|join(';') }}">
  77.                     <div class="">
  78.                         {% block moorl_foundation_listing_item_content %}
  79.                             <div itemprop="name" class="moorl-listing-item-title" title="{{ title }}">
  80.                                 {% block moorl_foundation_listing_item_title %}
  81.                                     {{ title|raw }}
  82.                                 {% endblock %}
  83.                             </div>
  84.                             {% if meta %}
  85.                                 <div class="moorl-listing-item-meta">
  86.                                     {% block moorl_foundation_listing_item_meta %}
  87.                                         {{ meta }}
  88.                                     {% endblock %}
  89.                                 </div>
  90.                             {% endif %}
  91.                             {% if description %}
  92.                                 <div itemprop="description" class="moorl-listing-item-description">
  93.                                     {% block moorl_foundation_listing_item_description %}
  94.                                         {{ description|raw }}
  95.                                     {% endblock %}
  96.                                 </div>
  97.                             {% endif %}
  98.                             {% if config.hasButton.value %}
  99.                                 <a itemprop="mainEntityOfPage"
  100.                                    href="{{ url }}" {% if config.urlNewTab.value %}target="_blank"
  101.                                    rel="noopener"{% endif %}
  102.                                    title="{{ config.buttonLabel.value }}"
  103.                                    class="{{ config.buttonClass.value }} moorl-listing-item-button">
  104.                                     {% block moorl_foundation_listing_item_button_label %}
  105.                                         {{ config.buttonLabel.value ?? "moorl-foundation.search.moreButton"|trans }}
  106.                                     {% endblock %}
  107.                                 </a>
  108.                             {% endif %}
  109.                         {% endblock %}
  110.                     </div>
  111.                 </div>
  112.             {% endif %}
  113.         {% endif %}
  114.     {% endblock %}
  115. {% endset %}
  116. {% if config.listingLayout.value == 'search-suggest' %}
  117.     {{ itemContent }}
  118. {% elseif config.itemLayout.value == 'custom' %}
  119.     <li class="{{ listingColumns }}">
  120.         {% sw_include config.itemLayoutTemplate.value %}
  121.     </li>
  122. {% elseif config.hasButton.value or not url %}
  123.     <li class="{{ listingColumns }}"
  124.         itemscope
  125.         itemtype="https://schema.org/{{ schemaOrgType }}">
  126.         <div class="moorl-listing-item-wrapper{% if config.itemHasBorder.value %} has-border{% endif %}"
  127.              style="{{ itemCss|join(';')|raw }}">
  128.             <div class="moorl-listing-item-{{ config.itemLayout.value }}">
  129.                 {{ itemContent }}
  130.             </div>
  131.         </div>
  132.     </li>
  133. {% else %}
  134.     <li class="{{ listingColumns }}"
  135.         itemscope
  136.         itemtype="https://schema.org/{{ schemaOrgType }}">
  137.         <a itemprop="mainEntityOfPage" href="{{ url }}" {% if config.urlNewTab.value %}target="_blank"
  138.            rel="noopener"{% endif %}
  139.            class="moorl-listing-item-wrapper{% if config.itemHasBorder.value %} has-border{% endif %}"
  140.            style="{{ itemCss|join(';')|raw }}"
  141.            title="{{ title }}">
  142.             <div class="moorl-listing-item-{{ config.itemLayout.value }}">
  143.                 {{ itemContent }}
  144.             </div>
  145.         </a>
  146.     </li>
  147. {% endif %}