0

Currently i'm using the MvcSiteMapProvider to provide my sitemap. I'm now converting my menu to use the same XML. I have created a MyMenu.cshtml with the following code

@model MvcSiteMapProvider.Web.Html.Models.MenuHelperModel
@using MvcSiteMapProvider.Web.Html.Models

<div class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
        @foreach (var node in Model.Nodes) { 
            <li>@Html.DisplayFor(m => node)</li>
        }
    </ul>
    @Html.Partial("_LoginPartial")
</div>

And i display it with

@Html.MvcSiteMap().Menu("MyMenu")

I'm trying to get nested menus to work. As i have some dropdown menu items that havesub catergories. For example

--Main Menu

------Sub Menu

What would be the best way to accomplish this?

MrBeanzy
  • 2,286
  • 3
  • 28
  • 38

1 Answers1

0

The menu templates are broken up into 3 separate parts, so you will need to override each part (not just the main one) by specifying the additional templates inside of your custom one. See this answer for a set of templates to get you started. Then it is just a matter of modifying the HTML the way you would like.

Community
  • 1
  • 1
NightOwl888
  • 55,572
  • 24
  • 139
  • 212