Skip to main content

getMenusByMarker

The 'Menus' module defines the structure and navigation of your site.

Description

It provides visitors with an easy way to move through sections of your application and find the information they need.

This method retrieves a single menu object based on its marker (marker) from the API. It returns a Promise that resolves to a single menu object IMenusEntity as a object with included pages.

Menus.getMenusByMarker(

marker, langCode

);

Parameters schema

Schema

marker(required): string
Menu marker
example: "main_menu"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

const response = await Menus.getMenusByMarker('my-marker')

Example response

{
"id": 1,
"identifier": "menu",
"localizeInfos": {
"title": "menu"
},
"pages": [
{
"id": null,
"pageUrl": null,
"localizeInfos": {},
"attributeValues": {},
"parentId": null,
"position": 1
}
]
}

Response schema

Schema: IMenusEntity

id: number
The unique identifier of the menu.
example: 1

identifier: string
The menu identifier.
example: "main_menu"

localizeInfos: ILocalizeInfo
The menu data, taking into account localization.
example:

{
"title": "menu"
}

pages: IMenusPages[]
Array of menu pages.
example:

[
{
"id": null,
"pageUrl": null,
"localizeInfos": {},
"attributeValues": {},
"parentId": null,
"position": 1
}
]