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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/breadcrumb.html.twig' %}
  2. {% block layout_breadcrumb_list_item %}
  3.     {% set homeShowInBreadcrumbMode = dreiscSeoCustomSettings.richSnippets.breadcrumb.home.showInBreadcrumbMode %}
  4.     {% set homeShowInBreadcrumb = 'onlyShop' == homeShowInBreadcrumbMode or 'shopAndJsonLd' == homeShowInBreadcrumbMode %}
  5.     {% set productShowInBreadcrumbMode = dreiscSeoCustomSettings.richSnippets.breadcrumb.product.showInBreadcrumbMode %}
  6.     {% set productShowInBreadcrumb = 'onlyShop' == productShowInBreadcrumbMode or 'shopAndJsonLd' == productShowInBreadcrumbMode %}
  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__layout_breadcrumb_list_item__add_home_breadcrumb %}
  10.         {% if homeShowInBreadcrumb and breadcrumb|keys|first == key %}
  11.             {% sw_include '@Storefront/storefront/dreisc-seo/component/breadcrumb/home.html.twig' with { } only %}
  12.         {% endif %}
  13.     {% endblock %}
  14.     {% if productShowInBreadcrumb %}
  15.         {% block dreisc_seo__layout_breadcrumb_list_item__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.             {% sw_include '@Storefront/storefront/dreisc-seo/component/breadcrumb/default.html.twig' with {
  18.                 ignoreActive: true
  19.             } %}
  20.         {% endblock %}
  21.     {% else %}
  22.         {# Otherwise: Call the parent as fallback #}
  23.         {% sw_include '@Storefront/storefront/dreisc-seo/component/breadcrumb/default.html.twig' with {
  24.             ignoreActive: false
  25.         } %}
  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__layout_breadcrumb_list_item__add_product_breadcrumb %}
  30.         {% if productShowInBreadcrumb and product.categoryTree|last == key %}
  31.             {% sw_include '@Storefront/storefront/dreisc-seo/component/breadcrumb/product.html.twig' with {
  32.                 product: product
  33.             } only %}
  34.         {% endif %}
  35.     {% endblock %}
  36. {% endblock %}