Skip to content

getBreadcrumbs()

The getBreadcrumbs method is used to get breadcrumbs for a current location in a storefront.

Returned value

The LinksList object.

Example

source
{% set breadcrumbs = ObjectApi.getBreadcrumbs() %}

<ul>
{% for link in breadcrumbs %}
    <li><a href="{{ link.url.absolute }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
output
<a href="https://example.com/category">Category</a>
<a href="https://example.com/category/subcategory">Subcategory</a>