Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of menu items when defined in code #114

Closed
waynebrantley opened this issue Dec 8, 2012 · 2 comments
Closed

Order of menu items when defined in code #114

waynebrantley opened this issue Dec 8, 2012 · 2 comments

Comments

@waynebrantley
Copy link

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?

@NightOwl888
Copy link
Collaborator

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.

@Jaans
Copy link

Jaans commented May 22, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants