How can I dynamic generate submenus by query the MenuSubItem entity?

How can I dynamic generate submenus by query the MenuSubItem entity?

  

How can I dynamic generate submenus by query the MenuSubItem entity?

Hi Alex,

I'm not sure what you mean by "dynamically generating submenus". Could you explain your use case?

Hi Alex,

As Kilian also mentions it's not completely clear what you are trying to do.

But technically speaking it's possible when you use a DropDownMenu WebBlock within a List Record to create as many submenus as there are records in the static entity MenuSubItem.

However, probably you will need to add a new attribute to the MenuSubItem entity because you will also need to add the destination of the SubMenu dynamically.

Best Regards,
Martijn Habraken

 

Martijn Habraken wrote:

Hi Alex,

As Kilian also mentions it's not completely clear what you are trying to do.

But technically speaking it's possible when you use a DropDownMenu WebBlock within a List Record to create as many submenus as there are records in the static entity MenuSubItem.

However, probably you will need to add a new attribute to the MenuSubItem entity because you will also need to add the destination of the SubMenu dynamically.

Best Regards,
Martijn Habraken

 

Hi,Martijn,thank you for reply.

My solution is basically same as yours.I create a new WebBlock for the List Records of SubMenu,because I cannot put the List Records into the SubMenuItem placeholder of DropDownMenu WebBlock directly.Then I put the DropDownMenu WebBlock into another List Records.The two List Records map to the MenuItem entity and SubMenuItem entity respectively.

For now on,I solved the Menu problem roughly.But I encounter another problem,I want to create the navigate bar dynamically.To be specifically,I want to generate links according to the relevant pages in the Breadcrumbs WebBlock automatically,instead of specifying the certain URL for each link.

Hi Alex,

If the WebBlocks from SILK UI or from richwidgets don't completely fit your course you could always make a clone of the module and make changes to the components. Offcourse you need to know what you are doing and take a good look how OutSystems implemented those WebBlocks.

Take note this is not a preferred practice and only a solution if you are stuck otherwise.