I'm configuring my asp.net mvc 5 app to use MvcSiteMap library. So, far I could successfully configure the breadcumbs.
However, the template for a menu is rather more complicated than the breadcumbs. I have the mustache version of the menu (I didn't show the ul tag):
<li{{#class}} class="{{class}}" {{ />class}}>{{! print class name (active, open, etc) if it exists }}
<a href="{{#link}}{{#createLinkFunction}}{{link}}{{/createLinkFunction}}{{/link}} {{^link}}#{{/link}}" {{#submenu?}} class="dropdown-toggle" {{ />submenu?}}>
{{#icon}}<i class="{{icon}}"></i>{{/icon}}
{{#level-1}}
<span class="menu-text">
{{/level-1}}
{{#level-2}}{{! if level-2 and no icon assigned, use this icon}}
{{^icon}}<i class="icon-double-angle-right"></i>{{/icon}}
{{/level-2}}
{{title}}
{{#badge}}
<span class="badge {{badge-class}} {{tooltip-class}}" {{#tooltip}} title="{{{tooltip}}}" {{ />tooltip}}>{{{badge}}}
</span>
{{/badge}}
{{#label}}
<span class="label {{label-class}}" {{#label-title}} title="{{label-title}}" {{ />label-title}}>{{{label}}}</span>
{{/label}}
{{#level-1}}
</span>
{{/level-1}}
{{#submenu?}}<b class="arrow icon-angle-down"></b>{{/submenu?}}
</a>
{{#submenu?}}{{! if we have submenu items, print them recursively }}
<ul class="submenu">
{{#submenu}}
{{> layout.sidenav.items}}
{{/submenu}}
</ul>
{{/submenu?}}
</li>
So, for every node, this is the logic to apply. I need to know if the node has subnodes (submenu), if it is a level 1 or level 2 node.
1) How can I know that?
2) If I need to change the SiteMapNodeModel.cshtml, which I think I need to change, how to not mess with the breadcumbs, since they use the same template?