custom/plugins/LoyxxRichBreadcrumb/src/Resources/views/storefront/page/content/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/content/index.html.twig' %}
  2. {% block cms_breadcrumb %}
  3.     {% if page.header.extensions.breadcrumb.getBreadcrumb() and not page.header.extensions.breadcrumb.invisibility and not page.header.navigation.active.translated.customFields.loyxx_rich_breadcrumb_disabled %}
  4.         <div id="richBreadcrumb" class="d-flex flex-wrap">
  5.         {% set navigationTree = page.header.navigation.tree %}
  6.         {% set category = page.header.navigation.active %}
  7.         {% block component_home_breadcrumb_url %}
  8.             {% if page.header.extensions.breadcrumb.showHomePageLink %}
  9.                 <div class="breadcrumb-container">
  10.                     <a class="{% if page.header.extensions.breadcrumb.uri is same as('/') %} is-active {% endif %}"
  11.                         {% if not shopware.config.LoyxxRichBreadcrumb.config.disableLinkTitle %}
  12.                             title="{{  page.header.extensions.breadcrumb.homeLabel ? page.header.extensions.breadcrumb.homeLabel : "loyxx.rich-breadcrumb.label.home" | trans   }}"
  13.                         {% endif %}
  14.                        href="{{ page.header.extensions.breadcrumb.host }}">
  15.                         {% if page.header.extensions.breadcrumb.homeLabel %}
  16.                             {{ page.header.extensions.breadcrumb.homeLabel }}
  17.                         {% else %}
  18.                             {{ "loyxx.rich-breadcrumb.label.home" | trans }}
  19.                         {% endif %}
  20.                     </a>
  21.                     {% if page.header.extensions.breadcrumb.uri is not same as('/') %}
  22.                         {% sw_include '@LoyxxRichBreadcrumb/storefront/layout/breadcrumb-separator.html.twig' ignore missing %}
  23.                     {% endif %}
  24.                 </div>
  25.             {% endif %}
  26.         {% endblock %}
  27.         {% set breadcrumb = category.buildSeoBreadcrumb(context.salesChannel.navigationCategoryId) %}
  28.         {% for key, item in breadcrumb %}
  29.             <div class="breadcrumb-container">
  30.             {% block component_listing_breadcrumb_category %}
  31.                 {% set hideLastLink = breadcrumb|last is same as (item)  and shopware.config.LoyxxRichBreadcrumb.config.disableLinkForLastItem %}
  32.                 <{{ hideLastLink ? 'strong' : 'a' }} class="{% if key is same as(category.id) %} is-active{% endif %}"
  33.                 {% if not shopware.config.LoyxxRichBreadcrumb.config.disableLinkTitle %}
  34.                     title="{{ item }}"
  35.                 {% endif %}
  36.                 {% if not hideLastLink %}
  37.                     href="{{ seoUrl('frontend.navigation.page', { navigationId: key }) }}"
  38.                 {% endif %}>
  39.                 {% block component_listing_breadcrumb_link_name %}
  40.                     {{ item }}
  41.                 {% endblock %}
  42.                 </{{ hideLastLink ? 'strong' : 'a' }}>
  43.             {% endblock %}
  44.             {% block component_listing_breadcrumb_placeholder %}
  45.                 {% if item != breadcrumb|last %}
  46.                     <div class="breadcrumb-placeholder">
  47.                         {% sw_include '@LoyxxRichBreadcrumb/storefront/layout/breadcrumb-separator.html.twig' %}
  48.                     </div>
  49.                 {% endif %}
  50.                 {% if item is same as(breadcrumb|last) and shopware.config.LoyxxRichBreadcrumb.config.showProductCount %}
  51.                     {# @var blockCollection \Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotCollection #}
  52.                     {% set slotCollection = page.cmsPage.sections.blocks.slots %}
  53.                     {# @var productListing \Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotEntity #}
  54.                     {% set productListing = null %}
  55.                     {# @var slot \Shopware\Core\Content\Cms\Aggregate\CmsSlot\CmsSlotEntity #}
  56.                     {% for slot in slotCollection %}
  57.                         {% if slot.type is same as('product-listing') %}
  58.                             {% set productListing = slot %}
  59.                         {% endif %}
  60.                     {% endfor %}
  61.                     {% if productListing is defined and productListing.data.listing.total %}
  62.                         <a href="#" class="" onclick="return false;">&nbsp;({{ productListing.data.listing.total | number_format}}  {{ ("loyxx.rich-breadcrumb.label." ~ (productListing.data.listing.total > 1 ? "items" : "item" )) | trans }})</a>
  63.                     {% endif %}
  64.                 {% endif %}
  65.             {% endblock %}
  66.             </div>
  67.         {% endfor %}
  68.         </div>
  69.     {% endif %}
  70. {% endblock %}