Skip to main content
Version: 2.0.0-alpha

Type alias: NavigationContext

Ƭ NavigationContext: Object

Context that includes the resolved navigation and utility methods and attributes.

Type declaration

baseCollectionPathstringDefault path under the collection routes of the CMS will be created
baseLocationstringLocation used as the base for routes. This is the location that will be used underneath, when the url changes while opening a side dialog
basePathstringDefault path under the navigation routes of the CMS will be created
collectionsEntityCollection[]List of the mapped collections in the CMS. Each entry relates to a collection in the root database. Each of the navigation entries in this field generates an entry in the main menu.
homeUrlstringBase url path for the home screen
initialisedbooleanIs the registry ready to be used
loadingbooleanIs the navigation loading (the configuration persistence has not loaded yet, or a specified navigation builder has not completed)
navigationLoadingError?anyWas there an error while loading the navigation data
topLevelNavigation?TopNavigationResultConfiguration for the views that should be displayed at the top level of the navigation (e.g. in the home page or the navigation drawer)
viewsCMSView[]Custom additional views created by the developer, added to the main navigation
buildCMSUrlPath(path: string) => stringConvert a collection or entity path to a URL path
buildUrlCollectionPath(path: string) => stringBuild a URL collection path from a data path products => /c/products products/B34SAP8Z => /c/products/B34SAP8Z
buildUrlEditCollectionPath(props: { path: string }) => string-
getCollection<M>(path: string, entityId?: string, includeUserOverride?: boolean) => undefined | EntityCollection<M, string, User>Get the collection configuration for a given path. If you use this method you can use a baseCollection that will be used to resolve the initial properties of the collection, before applying the collection configuration changes that are persisted. If you don't specify it, the collection is fetched from the local navigation.
isUrlCollectionPath(urlPath: string) => booleanCheck if a url path belongs to a collection
resolveAliasesFrom(pathWithAliases: string) => stringTurn a path with aliases into a resolved path
urlPathToDataPath(cmsPath: string) => stringConvert a URL path to a collection or entity path /c/products => products /my_cms/c/products/B34SAP8Z => products/B34SAP8Z /my_cms/my_view => my_view

Defined in