Developer forum

Forum » Development » Render Navigation for a specific User context

Render Navigation for a specific User context

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a solution that becomes more and more challenging because of the large number of Users, User groups, and Assortments.

Navigation rendering is becoming a real issue, even with the new approach. I understand that our setup is rather far from the standard way of setting up DW  and that's why I believe that I need to find alternate ways of handling otherwise standard functionalities.

That being said, what I am trying to do is pre-generate the mega menu for each CustomerNumber.

I see that I can pass some parameters to the Navigation Settings but in my case, I need to be able to generate the navigation in the context of a User.

And I have found the NavigationContext which seems to support a UserId.

I am just unsure how I can combine NavigationSettings and NavigationContext before trying to render Navigation.

Does anyone have any pointers?

Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

Sounds like a slipery slope you are on.

We actually have this one coming through our pipeline today: https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_git/Dynamicweb/pullrequest/9473 It deals with assortment performance and navigation with assortment performance.
So you might want to see the result of that before you dig in.

If you do dig in:

The NavigationContext is used by the NavigationService which returns nodes to the webapi and to the regular navigation throught the NavigationTemplateHelper.

NavigationService is not public. But you can create an instance of NavigationTemplateHelper and pass it a NavigationContext instance on the contructor and then call GetNavigationViewModel with the settings.

 

You must be logged in to post in the forum