Search code examples
sap-commerce-cloudspartacus-storefront

Is there additional configuration needed to make the breadcrumbs visible in a Spartacus site?


Is there additional configuration needed to make the breadcrumbs visible in a Spartacus-based site? There is a BreadcrumComponent instance inside the BottomHeaderSlot. If I load the page in the JSP-based site, a breadcrumb like "HOME / Warranty" is displayed for a /warranty page. But when I load the Spartacus-based site, it only shows "HOME". What am I missing? Do I need to edit the CMS controllers or map a breadcrumbBuilder to it?


Solution

  • I'm updating my answer as I misunderstood earlier, sorry for that.

    Breadcrumbs are resolved in Spartacus by a specific PageMetaResolver. The content pages are by default resolved by the ContentPageMetaResolver, which you could extend.

    The breakpoints resolved for Content pages (like the faq page in the sample data) are only contain a link to the home page. You could customise this by providing a custom implementation for the ContentPageMetaResolver.

    --- former answer, no longer relevant ---

    The visibility depends on the availability of the BreadcrumbComponent in the CMS structure. You can add this component in a page template or in a specific page.

    You'll see this on the demo site, see https://spartacus.c39j2-walkersde1-d4-public.model-t.cc.commerce.ondemand.com/. On the home page there's no notion of the breadcrumb, while on other pages there is. In the sampledata, the BreadcrumbComponent is part of the components of the BottomHeaderSlot.