Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Breadcrumb template component for Craft CMS based on Seomatic plugin. More info on http://craftsnippets.com/articles/breadcrumb-created-from-url-for-craft-cms
{% v1 %}
% set breadcrumbLinks = seomatic.jsonLd.get('breadcrumbList').itemListElement %}
{% if breadcrumbLinks|length > 1 %}
<nav class="breadcrumb" aria-label="{{'breadcrumbs'|t}}">
<ul>
{% for link in breadcrumbLinks %}
<li class="{{loop.last ? 'is-active'}}" {{loop.last ? 'aria-current="page"'}}>
<a href="{{ link.item['@id'] }}">
<span itemprop="name">{{ link.item['name'] }}</span>
</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.