templates/app/partials/navigation/_breadcrumbs.html.twig line 1

Open in your IDE?
  1. {# Branches > Voedingsindustrie > item 3 > current #}
  2. {# get root node if there is no document defined (for pages which are routed directly through static route) #}
  3. <div class="relative lg:container">
  4.     <div
  5.         class="{{ hideOnMobile is defined and hideOnMobile is true ? 'hidden md:block' : '' }} lg:absolute lg:left-0 lg:z-10"
  6.     >
  7.         <div class="container hidden py-4 mx-auto text-sm font-bold text-gray-800 md:text-base lg:block ">
  8.             <ul class="flex flex-row items-center">
  9.                 {% for breadCrumb in page.breadCrumbs %}
  10.                     {% if breadCrumb.item|default(null) %}
  11.                         <li class="flex flex-row items-center">
  12.                             {% if loop.first %}
  13.                                 <a href="{{ breadCrumb.item | trimUrl }}">
  14.                                     <svg class="relative -top-[1px]" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#8A8D94" fill-rule="evenodd" d="M13.80032 14.39996h-3.20008V9.59984H5.80012v4.80012H2.60004V5.99974999l5.60014-4.200105 5.60014 4.200105V14.39996Zm1.280032-9.44023601-6.40016-4.80012c-.2840071-.21280532-.6760169-.21280532-.960024 0l-6.40016 4.80012C1.11840296 5.11092777 1 5.34773369 1 5.59973999V15.19998c0 .4424111.35840896.80002.80002.80002h12.80032c.4424111 0 .80002-.3576089.80002-.80002V5.59973999c0-.2520063-.118403-.48881222-.320008-.640016Z"/></svg>
  15.                                 </a>
  16.                             {% elseif breadCrumb.item %}
  17.                                 <a href="{{ breadCrumb.item | trimUrl }}" class="first-letter:capitalize">
  18.                                     {% if breadCrumb.name ends with ' | Coolworld' %}
  19.                                         {{ breadCrumb.name|slice(0, -12) }}
  20.                                     {% else %}
  21.                                         {{ breadCrumb.name }}
  22.                                     {% endif %}
  23.                                 </a>
  24.                             {% else %}
  25.                                 <span class="first-letter:capitalize">{{ breadCrumb.name }}</span>
  26.                             {% endif %}
  27.                             {% if not loop.last %}
  28.                                 <svg class="rotate-180 mx-2.5" width="0.858em" height="0.858em" fill="currentColor" viewBox="0 0 10 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.685.344.722 7.075C.474 7.315.333 7.65.333 8c0 .35.14.685.389.925l6.963 6.732a1.206 1.206 0 0 0 1.749-.068l.09-.113a1.297 1.297 0 0 0-.154-1.67L3.36 8 9.37 2.193A1.295 1.295 0 0 0 9.434.41 1.205 1.205 0 0 0 7.685.344Z"/></svg>
  29.                             {% endif %}
  30.                         </li>
  31.                     {% endif %}
  32.                 {% endfor %}
  33.             </ul>
  34.         </div>
  35.         {% for breadCrumb in page.breadCrumbs | reverse %}
  36.             {# Skip the fist (last originally because reversed) because that's the current page. #}
  37.             {# Make sure the parent is a page, not a folder using breadCrumb.item. #}
  38.             {#{% if document.parent and document.parent is instanceof('\\Pimcore\\Model\\Document\\Page') %}#}
  39.             {% if not loop.first and breadCrumb.item %}
  40.                 <!-- The previous button for on mobile -->
  41.                 <a
  42.                     {#href="{{ document.parent.path | trimUrl }}"#}
  43.                     href="{{ breadCrumb.item | trimUrl }}"
  44.                     class="flex items-center h-full px-5 py-2 text-sm font-bold text-gray-800 md:py-3 lg:hidden md:text-base"
  45.                 >
  46.                     <span class="block w-2.5 h-4 mr-4">
  47.                         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16"><path fill="#8A8D94" fill-rule="evenodd" d="M7.685.344.722 7.075C.474 7.315.333 7.65.333 8c0 .35.14.685.389.925l6.963 6.732a1.206 1.206 0 0 0 1.749-.068l.09-.113a1.297 1.297 0 0 0-.154-1.67L3.36 8 9.37 2.193A1.295 1.295 0 0 0 9.434.41 1.205 1.205 0 0 0 7.685.344Z"/></svg>
  48.                     </span>
  49.                     <span>
  50.                         {#{{ document.parent.getProperty('navigation_name') ?: document.parent.title ?: document.parent.key }}#}
  51.                         {{ breadCrumb.name}}
  52.                     </span>
  53.                 </a>
  54.                 {% break %}
  55.             {% endif %}
  56.         {% endfor %}
  57.     </div>
  58. </div>
  59. <script type="application/ld+json">
  60.     {
  61.         "@context": "https://schema.org",
  62.         "@type": "BreadcrumbList",
  63.         "itemListElement": [
  64.             {% for breadCrumb in page.breadCrumbs %}
  65.             {
  66.                 "@type": "ListItem",
  67.                 "position": {{ loop.index }},
  68.                 "name": "{{ breadCrumb.name }}"{% if breadCrumb.item %},{% endif %}
  69.                 {% if breadCrumb.item %}
  70.                     "item": "{{ breadCrumb.item }}"
  71.                 {% endif %}
  72.             }{% if not loop.last %},{% endif %}
  73.             {% endfor %}
  74.         ]
  75.     }
  76. </script>