You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a controller with actions, it appears the menu is in the same order as the actions. Ok, so I can sort my action methods the way I want the menu to appear.
So, I have an action method Index() and the 5 other action methods that are submenus of that Index(). No problem. However, the Index() action is the submenu of the 'root' menu defined in XML. The menu is added to the end of the sitemap - I want it 3rd on the list.
How can we control the order?
The text was updated successfully, but these errors were encountered:
Upon reviewing the code, the MvcSiteMapNodeAttribute already has an Order field that is used to sort the nodes before processing them. However, this step is done before nesting them into a tree so I am not sure if it would meet your requirements. Ideally, the order should be applied after grouping the nodes by parent.
Please give it a try (ideally using the v4 branch) and post your findings.
As for DynamicNodes, they are put into the tree in the same order you create them, so I can't imagine an issue there.
It would be nice if we could also specify the order attribute on the mvcSiteMapNode and when the statically defined nodes and the dynamically generated (whether from controller attributes or a dynamicNodeProvider) the two are "merged".
This would allow me to control exactly the sequence.
At the moment, if I specify the order attribute on the mvcSiteMapNode, it gets output to the sitemap.xml file.
If I have a controller with actions, it appears the menu is in the same order as the actions. Ok, so I can sort my action methods the way I want the menu to appear.
So, I have an action method Index() and the 5 other action methods that are submenus of that Index(). No problem. However, the Index() action is the submenu of the 'root' menu defined in XML. The menu is added to the end of the sitemap - I want it 3rd on the list.
How can we control the order?
The text was updated successfully, but these errors were encountered: