[lightMode]
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
salla.api.component.getMenus('header')
.then(data => {
//...
})
.catch(error => {
//...
});
salla.api.component.getMenus('footer')
.then(data => {
//...
})
.catch(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)
});
[updatedIn] 5 days ago
Payload
Response
Usage
Events
onMenuFetched
onMenuFetchFailed