templates/_parts/breadcrumbs.html.twig line 1

Open in your IDE?
  1. {% set breadcrumbs = get_breadcrumbs() %}
  2. {% if breadcrumbs|length > 0 %}
  3.     <div class="breadcrumbs">
  4.         <ul class="breadcrumbs__list" itemscope itemtype="http://schema.org/BreadcrumbList">
  5.             <li class="breadcrumbs__item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
  6.                 <a href="/" class="breadcrumbs__link" itemscope itemtype="http://schema.org/Thing" itemprop="item">
  7.                     <span class="breadcrumbs__name" itemprop="name">Главная</span>
  8.                 </a>
  9.                 <meta itemprop="position" content="1"/>
  10.             </li>
  11.             {% for key, item in breadcrumbs %}
  12.                 <li class="breadcrumbs__item breadcrumbs__item_delimiter">
  13.                     &rarr;
  14.                 </li>
  15.                 <li class="breadcrumbs__item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
  16.                     {% if item.getUrl() %}
  17.                         <a href="{{ item.getUrl() }}" class="breadcrumbs__link" itemscope itemtype="http://schema.org/Thing" itemprop="item">
  18.                             <span class="breadcrumbs__name" itemprop="name">{{ item.getName() }}</span>
  19.                         </a>
  20.                     {% else %}
  21.                         <span class="breadcrumbs__name" itemprop="name">{{ item.getName() }}</span>
  22.                     {% endif %}
  23.                     <meta itemprop="position" content="{{ key + 2 }}"/>
  24.                 </li>
  25.             {% endfor %}
  26.         </ul>
  27.     </div>
  28. {% endif %}