-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the sitemap created at run time. #223
Comments
Yes, the sitemap should launch automatically if you have installed MvcSiteMapProvider.MVC4 in your project. If you have one of the DI modules packages, there are some additional steps needed to get it running (they can be found in the readme file in your A good way to check if the sitemap is running is to check the If you do, then I would suggest using the @Html.MvcSiteMap().SiteMap() HTML helper as a diagnostic tool to see if your nodes are nested correctly. It should give you an idea where in your configuration you have gone wrong. Note that you must have 1 root node - that is, there must be one node with no parent or it won't work. If you are still having trouble, I would suggest having a look at the MvcSiteMapProvider Test Drive tutorial. It walks through a basic installation, but it doesn't go over setting up MvcSiteMapNode attributes specifically. For that, I would suggest taking a look at the MvcMusicStore demo in the source code download. BTW - I wouldn't suggest doing this until you get it running, but if you want your configuration to be entirely convention based instead of using XML, have a look at #197. |
One more thing. In order for your project to be scanned for MvcSiteMapNodeAttribute, the assembly names must be configured. If you put your controllers in a different project than your MVC project, you need to ensure you include the assembly name in the configuration. Also, you must ensure the feature is enabled if using internal DI. Internal DI: <add key="MvcSiteMapProvider_IncludeAssembliesForScan" value="MyAssemblyName,MyOtherAssemblyName" />
<add key="MvcSiteMapProvider_ScanAssembliesForSiteMapNodes" value="true" /> External DI: string[] includeAssembliesForScan = new string[] { "MyAssemblyName", "MyOtherAssemblyName" }; |
Update I didn't realize how lacking the documentation for this feature was until you drew my attention to it. I have updated the wiki to include instructions on how to ensure the feature is enabled and the assemblies are scanned for, as well as provided better information about matching parent nodes. Were you able to get your configuration to work? |
I created a MVC4 web App. I`ve installed the correct verison of MvcSiteMapProvider from NuGet.
Then, every controller has the corresponding MvcSiteMapNode metadata attribute filled with the title and the parentkey fields.
There is a breadcumbar @Html.MvcSiteMap().SiteMapPath() in the Layout page.
Ok, Nothing happens. Breadcumbar is not displayed.
I don´t know if it is a simple question, but is the Sitemap created at runtime? Is the MVCSiteMapProvider been activated at startup as shown in the documentation or
I´m missing something?
Mvc.sitemap should be Hand made?
Thanks in advance for your response.
The text was updated successfully, but these errors were encountered: