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

Open in your IDE?
  1. {% block layout_breadcrumb_inner %}
  2.     {% if category %}
  3.         {% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
  4.         {% set categoryId = category.id %}
  5.         {% if breadcrumbCategories|length > 0 %}
  6.             <nav aria-label="breadcrumb">
  7.                 {% block layout_breadcrumb_list %}
  8.                     <ol class="breadcrumb m-0"
  9.                         itemscope
  10.                         itemtype="https://schema.org/BreadcrumbList">
  11.                         <li style="height: 1rem;">
  12.                             <a href="/" class="mr-3">
  13.                                 <div class="breadcrumb-placeholder">
  14.                                     <i class="fas fa-home"></i>
  15.                                 </div>
  16.                             </a>
  17.                         </li>
  18.                         <div class="breadcrumb-placeholder home-breadcrumb">
  19.                             {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  20.                         </div>
  21.                         {% for breadcrumbCategory in breadcrumbCategories %}
  22.                             {% set key = breadcrumbCategory.id %}
  23.                             {% set name = breadcrumbCategory.translated.name %}
  24.                             {% block layout_breadcrumb_list_item %}
  25.                                 <li class="breadcrumb-item"
  26.                                     {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  27.                                         {% if breadcrumbCategory.type != 'folder' %}
  28.                                     itemprop="itemListElement"
  29.                                     itemscope
  30.                                     itemtype="https://schema.org/ListItem"
  31.                                         {% endif %}>
  32.                                     {% if breadcrumbCategory.type == 'folder' %}
  33.                                         <div>{{ name }}</div>
  34.                                     {% else %}
  35.                                         {% if loop.last and not page.product %}
  36.                                             <span class="breadcrumb-title" itemprop="name">{{ name }}</span>
  37.                                         {% else %}
  38.                                             <a href="{{ category_url(breadcrumbCategory) }}"
  39.                                                class="breadcrumb-link"
  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.                                     {% endif %}
  50.                                 </li>
  51.                             {% endblock %}
  52.                             {% block layout_breadcrumb_placeholder %}
  53.                                 {% if not loop.last %}
  54.                                     <div class="breadcrumb-placeholder">
  55.                                         {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  56.                                     </div>
  57.                                 {% endif %}
  58.                             {% endblock %}
  59.                         {% endfor %}
  60.                         {% if page.product %}
  61.                             <div class="breadcrumb-placeholder">
  62.                                 {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  63.                             </div>
  64.                             <li>
  65.                                 <div class="breadcrumb-placeholder">
  66.                                     {{ page.product.translated.name|u.truncate(60, '...', false) }}
  67.                                 </div>
  68.                             </li>
  69.                         {% endif %}
  70.                     </ol>
  71.                 {% endblock %}
  72.             </nav>
  73.         {% endif %}
  74.     {% endif %}
  75. {% endblock %}