custom/plugins/DecomTheme/src/Resources/views/storefront/layout/breadcrumb.html.twig line 10

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/breadcrumb.html.twig' %}
  2. {% block layout_breadcrumb_inner %}
  3.     {% if category %}
  4.         {% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
  5.         {% set categoryId = category.id %}
  6.         {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  7.         {% set breadcrumb = sw_breadcrumb(category) %}
  8.         {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  9.         {% set breadcrumbKeys = breadcrumb|keys %}
  10.         {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  11.         {% set breadcrumbTypes = sw_breadcrumb_build_types(breadcrumbCategories) %}
  12.         {% if breadcrumbCategories|length > 0 %}            
  13.             {% if controllerName == 'Product' %} <div class="container"> {% endif %}
  14.                 <nav aria-label="breadcrumb">
  15.                     {% block layout_breadcrumb_list %}
  16.                         <ol class="breadcrumb"
  17.                             itemscope
  18.                             itemtype="https://schema.org/BreadcrumbList">
  19.                             <li class="breadcrumb-item first-item">
  20.                                 <a href="{{ path('frontend.home.page') }}" itemprop="item" class="breadcrumb-link">
  21.                                     <link itemprop="url"
  22.                                         href="{{ path('frontend.home.page') }}"/>
  23.                                     {{ context.salesChannel.name|capitalize }}
  24.                                 </a>
  25.                             </li>
  26.                             {% for breadcrumbCategory in breadcrumbCategories %}
  27.                                 {% set key = breadcrumbCategory.id %}
  28.                                 {% set name = breadcrumbCategory.translated.name %}
  29.                                 {% block layout_breadcrumb_list_item %}
  30.                                     <li class="breadcrumb-item"
  31.                                         {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  32.                                         itemprop="itemListElement"
  33.                                         itemscope
  34.                                         itemtype="https://schema.org/ListItem">
  35.                                         {% if breadcrumbCategory.type == 'folder' %}
  36.                                             <div itemprop="name" style="display: inline-block;">{{ name }}</div>
  37.                                         {% else %}
  38.                                             <a href="{{ category_url(breadcrumbCategory) }}"
  39.                                             class="breadcrumb-link {% if key is same as(categoryId) %} is-active{% endif %}"
  40.                                             title="{{ name }}"
  41.                                             {% if category_linknewtab(breadcrumbCategory) %}target="_blank"{% endif %}
  42.                                             itemprop="item">
  43.                                                 <link itemprop="url"
  44.                                                     href="{{ category_url(breadcrumbCategory) }}"/>
  45.                                                 <span class="breadcrumb-title" itemprop="name">{{ name }}</span>
  46.                                             </a>
  47.                                         {% endif %}
  48.                                         <meta itemprop="position" content="{{ loop.index }}"/>
  49.                                     </li>
  50.                                 {% endblock %}
  51.                                 {% block layout_breadcrumb_placeholder %}
  52.                                     {% if key != breadcrumbKeys|last %}
  53.                                         <div class="breadcrumb-placeholder">
  54.                                             &gt;
  55.                                         </div>
  56.                                     {% endif %}
  57.                                 {% endblock %}
  58.                             {% endfor %}
  59.                             {% if controllerName == 'Product' %}
  60.                                 <li class="breadcrumb-item"
  61.                                     itemprop="itemListElement"
  62.                                     itemscope
  63.                                     itemtype="https://schema.org/ListItem">
  64.                                     <span itemprop="name">{{ misc.translated.name }}</span>
  65.                                 </li>
  66.                             {% endif %}
  67.                         </ol>
  68.                     {% endblock %}
  69.                 </nav>
  70.             {% if controllerName == 'Product' %} </div> {% endif %}
  71.         {% endif %}
  72.     {% endif %}
  73.     {% if controllerName == 'Blog' %}
  74.         <nav aria-label="breadcrumb">
  75.             {% block layout_breadcrumb_list_blog %}
  76.                 <ol class="breadcrumb"
  77.                     itemscope
  78.                     itemtype="https://schema.org/BreadcrumbList">
  79.                     <li class="breadcrumb-item first-item">
  80.                         <a href="{{ path('frontend.home.page') }}" itemprop="item" class="breadcrumb-link">
  81.                             <link itemprop="url"
  82.                                 href="{{ path('frontend.home.page') }}"/>
  83.                             {{ context.salesChannel.name|capitalize }}
  84.                         </a>
  85.                     </li>
  86.                     <li class="breadcrumb-item">
  87.                         <a href="/{{ controllerName }}/" itemprop="item" class="breadcrumb-link">
  88.                             <link itemprop="url"
  89.                                 href="/{{ controllerName }}/"/>
  90.                             {{ controllerName }}
  91.                         </a>
  92.                     </li>
  93.                     {% if misc.blogCategories %}
  94.                         {% if misc.blogCategories.elements %}                            
  95.                             {% if misc.blogCategories.elements|first %}
  96.                                 {% set categoryElement = misc.blogCategories.elements|first %}
  97.                                 <li class="breadcrumb-item">
  98.                                     <a href="/{{ controllerName }}/{{ categoryElement.name }}/" itemprop="item" class="breadcrumb-link">
  99.                                         <link itemprop="url"
  100.                                             href="/{{ controllerName }}/{{ categoryElement.name }}/"/>
  101.                                         {{ categoryElement.name }}
  102.                                     </a>
  103.                                 </li>                                
  104.                             {% endif %}
  105.                         {% endif %}
  106.                     {% endif %}
  107.                     <li class="breadcrumb-item">
  108.                         {% set currentPath = app.request.attributes.get('sw-original-request-uri') %}
  109.                         <a href="{{ currentPath }}" itemprop="item" class="breadcrumb-link">
  110.                             <link itemprop="url"
  111.                                 href="{{ currentPath }}"/>
  112.                             {{ misc.title }}
  113.                         </a>
  114.                     </li>
  115.                 </ol>
  116.             {% endblock %}
  117.         </nav>
  118.     {% endif %}
  119. {% endblock %}