Appearance
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 ​
| Name | Type | Description |
|---|---|---|
| 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,
});