Light Mode
Menus
This endpoint retrieves menus for a specified component, such as "header"
or "footer"
. It is commonly used to fetch menus for a particular component in your theme, typically for dynamically rendering navigation or other UI elements. While "header"
is the default component, you can specify "footer"
where needed.
Payload
Response
Usage
getMenus()
.then(data => {
// Handle the fetched menu data
})
.catch(error => {
// Handle the error
});
getMenus("footer")
.then(data => {
// Handle the fetched menu data
})
.catch(error => {
// Handle the error
});
Events
The menu process may trigger two events during the menu process, onMenuFetched and onMenuFetchFailed.
onMenuFetched
Triggered when the menus are successfully fetched.
salla.event.component.onMenuFetched((response) => {
console.log(response)
});
onMenuFetchFailed
Triggered if there is an error during the fetching process.
salla.event.component.onMenuFetchFailed((errorMessage) => {
console.log(errorMessage)
});
Last modified: 23 days ago