Skip to content

NavigationController

@firecms/core


@firecms/core / NavigationController

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.

EC extends EntityCollection = EntityCollection<any>

optional adminViews: CMSView[]

Defined in: types/navigation.ts:32

Custom additional views created by the developer, added to the admin navigation


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: 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: (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

string

string


optional collections: 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: (ids) => string[]

Defined in: types/navigation.ts:146

Resolve paths from a list of ids

string[]

string[]


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.

string

boolean

EC | undefined


getCollectionById: (id) => EC | undefined

Defined in: types/navigation.ts:66

Get the top level collection configuration for a given id

string

EC | undefined


getCollectionFromIds: (ids) => EC | undefined

Defined in: types/navigation.ts:71

Get the collection configuration from its parent ids.

string[]

EC | undefined


getCollectionFromPaths: (pathSegments) => EC | undefined

Defined in: types/navigation.ts:76

Get the collection configuration from its parent path segments.

string[]

EC | undefined


getParentCollectionIds: (path) => string[]

Defined in: types/navigation.ts:140

Retrieve all the related parent collection ids for a given path

string

string[]


getParentReferencesFromPath: (path) => EntityReference[]

Defined in: types/navigation.ts:134

Retrieve all the related parent references for a given path

string

EntityReference[]


homeUrl: string

Defined in: types/navigation.ts:102

Base url path for the home screen


initialised: boolean

Defined in: types/navigation.ts:55

Is the registry ready to be used


isUrlCollectionPath: (urlPath) => boolean

Defined in: types/navigation.ts:108

Check if a url path belongs to a collection

string

boolean


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: (to, options?) => void

Defined in: types/navigation.ts:154

A function to navigate to a specified route or URL.

string

The target route or URL to navigate to.

NavigateOptions

Optional configuration settings for navigation, such as replace behavior or state data.

void


optional navigationLoadingError: any

Defined in: types/navigation.ts:50

Was there an error while loading the navigation data


optional plugins: FireCMSPlugin<any, any, any>[]

Defined in: types/navigation.ts:159

Plugin system allowing to extend the CMS functionality.


refreshNavigation: () => void

Defined in: types/navigation.ts:128

Call this method to recalculate the navigation

void


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)

string

string


optional topLevelNavigation: 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: (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

string

string


optional views: CMSView[]

Defined in: types/navigation.ts:26

Custom additional views created by the developer, added to the main navigation