I have difficulties with the mvc sitemap provider for multiple areas. I have 5 diff areas in total and I tried different approaches to solve my problem. I tried to specify specific sitemap provider in the global web.config which didnt work and I tried to use a SiteMapCacheKey but i also didn t work. I finally found a way to make it work for one area:
<mvcSiteMapNode title="$resources:Mvc.sitemap,mvc_Home" area="Admin" controller="Home" action="Index" preservedRouteParameters="culture">
But this way just used the sitemap for the "Admin" area and not the 4 other areas. Now Im unsure what to do next. I just wanted to build a breadcrumb based on a sitemap hirarchy but if it doesnt work in combination with multiple areas I cant use it. Additionally I use a different Layout for each area which call
@Html.MvcSiteMap().SiteMapPath()
Now I would like to know if someone already solved this problem and would be so nice to help me. It would be enough if I could specifiy in each Layout which mvc.sitemap file should be used. This way I could just write area specific sitemaps.
Hope someone can help.
UPDATE: I found a workaround for my problem. I just specified in my mvc.sitemap nearly identical mvcSitemapNode. They just have different area tag.
<mvcSiteMapNode title="$resources:Mvc.sitemap,mvc_Home" area="Admin" controller="Home" action="Index" preservedRouteParameters="culture">
<mvcSiteMapNode title="$resources:Mvc.sitemap,mvc_Home" area="User" controller="Home" action="Index" preservedRouteParameters="culture">
Its not ideal but it works.