简体   繁体   中英

sitecore 6.6 MVC and MVCsitemap

I have just setup a new Sitecore 6.6 MVC application and all is going well.

I need a breadcrumb trail and found this: http://nuget.org/packages/MvcSiteMapProvider

I have set it up and it renders the @Html.MvcSiteMap().SiteMap() correctly but it doesn't render anything for bread crumb: @Html.MvcSiteMap().SiteMapPath()

If I debug into the SiteMapPathHelperModel.cshtml I can see that there are no nodes in my Model.

First question is, can and should I use: http://nuget.org/packages/MvcSiteMapProvider in MVC with Sitecore.

Second question is: If you think it is ok to use this, do you have any idea why it doesnt render my bread crumb but it renders the menu?

I have never used SiteCore, so I don't know how it is set up exactly. However, MvcSiteMapProvider is flexible and can accommodate many scenarios.

The SiteMapPath() will render if you navigate to one of the URLs that are registered in the Mvc.sitemap XML file. Note that in most cases you need to register them with a controller and action attribute set. The whole principle is based on matching a unique node within the sitemap to a route, so you need to ensure that both the node and the route of the request have matching RouteValues dictionaries.

See the MvcMusicStore demo in the source code download if you need to see a working implementation to get started, or have a look at this tutorial:

http://www.shiningtreasures.com/post/2013/08/07/MvcSiteMapProvider-40-a-test-drive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM