Skip to content
Shopware

useNavigationContext

useNavigationContext

Composable to get navigation context from the URL.

Types

ts
export function useNavigationContext(
  context?: Ref<Schemas["SeoUrl"] | null>,
): UseNavigationContextReturn

source code

ts
export type UseNavigationContextReturn = {
  /**
   * SEO URL from the navigation context
   */
  navigationContext: ComputedRef<Schemas["SeoUrl"] | null>;
  /**
   * Route name from the navigation context
   */
  routeName: ComputedRef<Schemas["SeoUrl"]["routeName"] | undefined>;
  /**
   * Foreign key (ID) for current navigation context
   */
  foreignKey: ComputedRef<string>;
};

source code