Create a submenu with 1 level.

Dec 2, 2010 at 7:30 PM


First: Very great tool.


I'm trying to create a submenu from current node with only one level, but it seams impossible?

My idea:

Create a main menu with all nodes on level 0:

<%: Html.MvcSiteMap().Menu(0,1) %>

Create a submenu which always show the current node, nodes, but only one level down.


Is this possible or do I have to crate some custom code?

Dec 3, 2010 at 9:14 AM

Can you try using one of the latest source code commits (check the source control tab, branches, 2.3.0). I've experienced the same problem and fixed it in there, but that's not yet part of the official release.

Dec 5, 2010 at 9:38 AM

I have downloaded the latest source in the 2.3.0 branch, and the tried to use this:

Menu(this MvcSiteMapProvider.Web.Html.MvcSiteMapHtmlHelper, bool, bool, bool)

Thats the only method that support "startFromCurrentNode" but it's not working.

Seems it's missing a "maxDepth" :)

Any suggestion?



Dec 6, 2010 at 4:59 PM
Edited Dec 6, 2010 at 5:01 PM

That's what I need too (maxdepth) but for now I'm just using this syntax.

I have a three level sitemap and most of my 2nd level nodes have one 3rd level node and the above works fine for those and for those 2nd level nodes that have no 3rd level child nodes but it doesn't work when we are located at the root sitenode (1st level) - it should stop at 2nd level nodes but it doesn't and goes all the way down to the 3rd level nodes.

<%: Html.MvcSiteMap().Menu(true, true, false) %>