59
Views
1
Comments
Scalable Hierarchy List/Menu
Application Type
Reactive

Hi all,

I'd like to know if there's a way (not using Forge components not supported by OS) to build a scalable hierarchy list menu/tree that doesn't have a fixed maximum child number.

For example, an hierarchy menu that would either allow 2 or 5 sublevels to be listed, depending on the situation.


Thank you,

PS

2022-03-19 07-12-06
Alec Manabat

Hi @Pedro Sismeiro,

If you are trying to do a hierarchical structure, you may want to try this structure I've implemented to achieve the same behavior as what you are trying to do, just in my case it was for a dynamic breadcrumb.You may want to save your menu names on an entity and for top level menus, leave the Nested field as nullidentifier, while everything else that is under a top level menu or a sub-menu, should have the ID of the top level menus in their Nested attribute.

For better visualization of what I'm talking about:

There are 2 top level menus, Top level menu 1 and top level menu 2. Nested attribute remained null meaning they ARE NOT under any top level menu, they ARE the top level menu.

Sub-menu 1 is under Top level menu 1, that's why in its Nested attribute, the id of Top level menu is present. Likewise Sub-menu 2 is under Top level menu 2.

Sub-menu 2.1 is under sub-menu 2, and sub-menu 2.1.1 is under sub-menu 2.1.

Then just create a web block that has a list wherein the sub menu are hidden until the their parent menu is clicked or hovered on. This is a bit tricky but, I hope you get my point and this idea helps you.

Regards,
Alec

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.