custom/plugins/DreiscSeoPro/src/Resources/views/storefront/component/product/breadcrumb.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/breadcrumb.html.twig' %}
  2. {% block component_product_breadcrumb_category %}
  3.     {% set productShowInBreadcrumbMode = dreiscSeoCustomSettings.richSnippets.breadcrumb.product.showInBreadcrumbMode %}
  4.     {% set homeShowInBreadcrumbMode = dreiscSeoCustomSettings.richSnippets.breadcrumb.home.showInBreadcrumbMode %}
  5.     {% set productShowInBreadcrumb = 'onlyShop' == productShowInBreadcrumbMode or 'shopAndJsonLd' == productShowInBreadcrumbMode %}
  6.     {% set homeShowInBreadcrumb = 'onlyShop' == homeShowInBreadcrumbMode or 'shopAndJsonLd' == homeShowInBreadcrumbMode %}
  7.     {# Make sure, that we are before the first item #}
  8.     {# EXPLAIN: key = current id of the breadcrumb array; breadcrumb|keys|first = id of the first breadcrumb item #}
  9.     {% block dreisc_seo__component_product_breadcrumb_category__add_home_breadcrumb %}
  10.         {% if homeShowInBreadcrumb and breadcrumb|keys|first == key %}
  11.             {% sw_include '@Storefront/storefront/dreisc-seo/component/home/breadcrumb.html.twig' with { } only %}
  12.         {% endif %}
  13.     {% endblock %}
  14.     {% if productShowInBreadcrumb %}
  15.         {% block dreisc_seo__component_product_breadcrumb_category__modify_default %}
  16.         {# We make sure that we do not set the is-active class because the product name is issued as a bread crumb. #}
  17.         <a href="{{ seoUrl('frontend.navigation.page', { navigationId: key }) }}">
  18.             {% block component_product_breadcrumb_link_name %}
  19.                 {{ item }}
  20.             {% endblock %}
  21.         </a>
  22.         {% endblock %}
  23.     {% else %}
  24.         {# Otherwise: Call the parent as fallback #}
  25.         {{ parent() }}
  26.     {% endif %}
  27.     {# Check, if we reached the last breadcrumb item #}
  28.     {# EXPLAIN: key = current id of the breadcrumb array; product.categoryTree|last = last id of the breadcrumb array #}
  29.     {% block dreisc_seo__component_product_breadcrumb_category__add_product_breadcrumb %}
  30.     {% if productShowInBreadcrumb and product.categoryTree|last == key %}
  31.         {% sw_include '@Storefront/storefront/dreisc-seo/component/product/breadcrumb.html.twig' with {
  32.             product: product
  33.         } only %}
  34.     {% endif %}
  35.     {% endblock %}
  36. {% endblock %}