Skip to content
On this page

getCategoryBreadcrumbs ​

Definition ​

Gather breadcrumbs from category

Signature ​

ts
export function getCategoryBreadcrumbs<
  T extends {
    translated?: {
      breadcrumb?: string[];
    };
    breadcrumb?: string[];
  },
>(
  category: T,
  options?: {
    /**
     * Start at specific index if your navigation
     * contains root names which should not be visible.
     */
    startIndex?: number;
  },
) 

Parameters ​

NameTypeDescription
category
T
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