Skip to content
On this page

getCategoryBreadcrumbs

Definition

Gather breadcrumbs from category

Signature

ts
export function getCategoryBreadcrumbs(
  category: Category | null | undefined,
  options?: {
    /**
     * Start at specific index if your navigation
     * contains root names which should not be visible.
     */
    startIndex?: number;
  }
) 

Parameters

NameTypeDescription
category
Category |  | undefined
category entity
options
{
    /**
     * Start at specific index if your navigation
     * contains root names which should not be visible.
     */
    startIndex?: number;
  }

Usage

ts
const breadcrumbs = getCategoryBreadcrumbs(product.seoCategory);
ts
const breadcrumbs = getCategoryBreadcrumbs(categoryResponse.value, {
  startIndex: 2,
});
getCategoryBreadcrumbs has loaded