maartenba/MvcSiteMapProvider — Issue #23: Sitemap when using same controller and action and routedata in several paths
Author: momoski
Created: 2012-02-05 00:32:07+00:00
State: open

I am breaking my head on this one:

Situation:

List of items, let's say electronic devices. I have the following route:

PATH1: radios -> small radios > list of small radio's > small radio#1

and

PATH2: consumer electronics -> audio devices -> list of audio devices > small radio#1

I have managed to create a menu structure with the dynamicnodeprovider that creates all paths. Because I couldnt get a breadcrumb on the detail page, I also added the detail page with routedata to the nodecollection.

So now when viewing the sitemap it all appears correct. I can see the small radio #1 page twice, each under a different path, which is good.

However when arriving to small radio #1 page via PATH1, I get to see the breadcrumb that belongs to PATH2.

How can I make the breadcrumb to appear as PATH1 when using PATH1 and as PATH2 when using PATH to get to the same page.

When I debug, I see that the node gets added twice: First with Key=PATH1_XXX_XXX_DEVICE1 and 2nd time with Key = PATH2_XXX_XXX_DEVICE1. The fact is, that both the times exactly the same controller, same routedata is used.

Could it be that SiteMapPath uses unique entries based on that rather then on the key. This in opposite to the SiteMap, which appears correct.

If more info is needed, please let me know