Convertigo Public Knowledge base

Create Menu and sub-menus

To make sub-menus, MenuAutoItems component can not be used, it has to be done “manually”.

Most of the Palette components can be used to create Menu and Sub-menus (Grid, List items, Buttons, Icons, Accordion Group, …).

The Accordion Group component is likely to be the most useful one.

Here is an example :

You can think of a more sophisticated and complex menus using code to automatically retrieve pages name and build menu and sub-menus with a ForEach Directive:

let pages = this.router.pagesArray; // Function that returns an Array of Pages with their properties
// Function that returns the name of the active page. // In 'Edit Application class' or in 'Edit Page class' public getActivePage() { let url = this.angularRouter.routerState.snapshot.url; console.log("current url is: ", url) for (let page of this.appPages) { if (url.substring(1).startsWith(page["url"])) { console.log("active page is: ", page["name"]) return page["name"] } } return "" }

With this helper functions you can build an automatic menu and sub-menus.

(c) Convertigo 2023 https://www.convertigo.com