NavigationController
@firecms/core / NavigationController
Type Alias: NavigationController<EC>
Section titled “Type Alias: NavigationController<EC>”NavigationController<
EC> =object
Defined in: types/navigation.ts:12
Controller that includes the resolved navigation and utility methods and attributes. This controller holds the state of the navigation including the collections.
Type Parameters
Section titled “Type Parameters”EC extends EntityCollection = EntityCollection<any>
Properties
Section titled “Properties”adminViews?
Section titled “adminViews?”
optionaladminViews:CMSView[]
Defined in: types/navigation.ts:32
Custom additional views created by the developer, added to the admin navigation
baseCollectionPath
Section titled “baseCollectionPath”baseCollectionPath:
string
Defined in: types/navigation.ts:88
Default path under the collection routes of the CMS will be created. It defaults to ‘/c’
basePath
Section titled “basePath”basePath:
string
Defined in: types/navigation.ts:82
Default path under the navigation routes of the CMS will be created.
Defaults to ’/’. You may want to change this basepath to ‘admin’ for example.
buildUrlCollectionPath()
Section titled “buildUrlCollectionPath()”buildUrlCollectionPath: (
path) =>string
Defined in: types/navigation.ts:116
Build a URL collection path from a data path
products => /c/products
products/B34SAP8Z => /c/products/B34SAP8Z
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
collections?
Section titled “collections?”
optionalcollections:EntityCollection[]
Defined in: types/navigation.ts:20
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.
convertIdsToPaths()
Section titled “convertIdsToPaths()”convertIdsToPaths: (
ids) =>string[]
Defined in: types/navigation.ts:146
Resolve paths from a list of ids
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”string[]
getCollection()
Section titled “getCollection()”getCollection: (
pathOrId,includeUserOverride?) =>EC|undefined
Defined in: types/navigation.ts:61
Get the collection configuration for a given path. The collection is resolved from the given path or alias.
Parameters
Section titled “Parameters”pathOrId
Section titled “pathOrId”string
includeUserOverride?
Section titled “includeUserOverride?”boolean
Returns
Section titled “Returns”EC | undefined
getCollectionById()
Section titled “getCollectionById()”getCollectionById: (
id) =>EC|undefined
Defined in: types/navigation.ts:66
Get the top level collection configuration for a given id
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”EC | undefined
getCollectionFromIds()
Section titled “getCollectionFromIds()”getCollectionFromIds: (
ids) =>EC|undefined
Defined in: types/navigation.ts:71
Get the collection configuration from its parent ids.
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”EC | undefined
getCollectionFromPaths()
Section titled “getCollectionFromPaths()”getCollectionFromPaths: (
pathSegments) =>EC|undefined
Defined in: types/navigation.ts:76
Get the collection configuration from its parent path segments.
Parameters
Section titled “Parameters”pathSegments
Section titled “pathSegments”string[]
Returns
Section titled “Returns”EC | undefined
getParentCollectionIds()
Section titled “getParentCollectionIds()”getParentCollectionIds: (
path) =>string[]
Defined in: types/navigation.ts:140
Retrieve all the related parent collection ids for a given path
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string[]
getParentReferencesFromPath()
Section titled “getParentReferencesFromPath()”getParentReferencesFromPath: (
path) =>EntityReference[]
Defined in: types/navigation.ts:134
Retrieve all the related parent references for a given path
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”homeUrl
Section titled “homeUrl”homeUrl:
string
Defined in: types/navigation.ts:102
Base url path for the home screen
initialised
Section titled “initialised”initialised:
boolean
Defined in: types/navigation.ts:55
Is the registry ready to be used
isUrlCollectionPath()
Section titled “isUrlCollectionPath()”isUrlCollectionPath: (
urlPath) =>boolean
Defined in: types/navigation.ts:108
Check if a url path belongs to a collection
Parameters
Section titled “Parameters”urlPath
Section titled “urlPath”string
Returns
Section titled “Returns”boolean
loading
Section titled “loading”loading:
boolean
Defined in: types/navigation.ts:45
Is the navigation loading (the configuration persistence has not loaded yet, or a specified navigation builder has not completed)
navigate()
Section titled “navigate()”navigate: (
to,options?) =>void
Defined in: types/navigation.ts:154
A function to navigate to a specified route or URL.
Parameters
Section titled “Parameters”string
The target route or URL to navigate to.
options?
Section titled “options?”Optional configuration settings for navigation, such as replace behavior or state data.
Returns
Section titled “Returns”void
navigationLoadingError?
Section titled “navigationLoadingError?”
optionalnavigationLoadingError:any
Defined in: types/navigation.ts:50
Was there an error while loading the navigation data
plugins?
Section titled “plugins?”
optionalplugins:FireCMSPlugin<any,any,any>[]
Defined in: types/navigation.ts:159
Plugin system allowing to extend the CMS functionality.
refreshNavigation()
Section titled “refreshNavigation()”refreshNavigation: () =>
void
Defined in: types/navigation.ts:128
Call this method to recalculate the navigation
Returns
Section titled “Returns”void
resolveIdsFrom()
Section titled “resolveIdsFrom()”resolveIdsFrom: (
pathWithAliases) =>string
Defined in: types/navigation.ts:123
Turn a path with collection ids into a resolved path. The ids (typically used in urls) will be replaced with relative paths (typically used in database paths)
Parameters
Section titled “Parameters”pathWithAliases
Section titled “pathWithAliases”string
Returns
Section titled “Returns”string
topLevelNavigation?
Section titled “topLevelNavigation?”
optionaltopLevelNavigation:NavigationResult
Defined in: types/navigation.ts:39
Configuration for the views that should be displayed at the top level of the navigation (e.g. in the home page or the navigation drawer)
urlPathToDataPath()
Section titled “urlPathToDataPath()”urlPathToDataPath: (
cmsPath) =>string
Defined in: types/navigation.ts:97
Convert 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
Parameters
Section titled “Parameters”cmsPath
Section titled “cmsPath”string
Returns
Section titled “Returns”string
views?
Section titled “views?”
optionalviews:CMSView[]
Defined in: types/navigation.ts:26
Custom additional views created by the developer, added to the main navigation