0

Hope someone can help as I can't seem to get this working and can't find anywhere on the net with the same issue.

My sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0"
            xsi:schemaLocation="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-4.0 MvcSiteMapSchema.xsd"
            >
  <mvcSiteMapNode title="Website Home" url="www.someaddress.com">
    <mvcSiteMapNode title="menu1" url="#">
      <mvcSiteMapNode title="sub1" url="www.someaddress2.com">
        <mvcSiteMapNode title="sub of sub1" url="www.someaddress3.com" ></mvcSiteMapNode>
      </mvcSiteMapNode>      
    </mvcSiteMapNode>   
  </mvcSiteMapNode>
</mvcSiteMap>

I then display the menu as such:

@Html.MvcSiteMap().Menu()

As a result I'd expect:

    Website Home | Menu 1
                    | Sub 1
                        |Sub of Sub 1

Then when hovering over Menu1 Sub1 appears, and when hovering over Sub1, Sub of Sub 1 appears.

Currently this doesn't work, regardless of the XML markup having child nodes etc it always displays that all flat so:

    Website Home | Menu 1
                     | Sub 1
                     |Sub of Sub 1

Can't seem to find a way to get a 3 level menu.

jaymarvels
  • 436
  • 1
  • 8
  • 21

1 Answers1

0

The menu is a templated MVC HTML helper. The default template is designed to work primarily with the default templates of MVC 4 and 5 (if you upgrade MvcSiteMapProvider.Web to the latest version it works with MVC 5, but NuGet does not install it by default), but has no fancy JavaScript menus or the like.

You can also edit the HTML to match whatever JavaScript/CSS framework you are using to control the user interaction with the Menu, but there is no such framework included in the package. See this answer for a starting point on customizing the menu templates to meet your needs.

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