The Portal Site Connection can be a useful way of making your breadcrumbs link to a site collection that is ‘above’ them in the logical architecture of a site. It’s also a good way of navigating out of Search Sites and My Sites – which are kind of navigational black holes.
Unfortunately, they don’t work in Publishing sites. I investigated why.
Well, my hunch was that it was related to the SiteMapProvider that publishing pages use. I knew that publishing pages use a different set of site map providers. So, I copied the ListSiteMapPath control on a publishing page, and changed it’s provider to be the same as on a Team Site. Below shows the Publishing ListeSiteMapPath control, and then one using the same provider as a team site:
So, CurrentNavigation doesn’t obey the Portal Site Map Connection, but SPSiteMapProvider does. What are these defined as? Well, they’re in Web.config.
<add name="SPSiteMapProvider" type="Microsoft.SharePoint.Navigation.SPSiteMapProvider, Microsoft.SharePoint, Version=126.96.36.199, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /> <add name="CurrentNavigation" description="Provider for MOSS Current Navigation" type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=188.8.131.52, Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Current" Version="14" />
So, why two different providers? Well, basically, the SPSiteMapProvider (and other non-publishing navigation providers) don’t know about Publishing Pages:
As you can see, this shows how one provider shows pages, but the other can show the Portal Site Map Connection. So it appears that Publishing Navigation Providers don’t ‘know’ about the Portal Site Map Connection, and that we can’t use it in Publishing Sites. Which sucks.
Oh, I did try different NavigationTypes (Global, Current, Combined) – it didn’t work for any of them. And I tried other navigation providers:
Doesn’t show the portal site map connection, and it does show the Pages library level.
And SPNavigationProvider just seemed to throw an ArgumentOutOfRange exception:
So, conclusion – you can’t use a Portal Site Map Connection in a Publishing Site. The Publishing SiteMapProviders are too important to swap out, and they just don’t understand the Portal Site Map Connection.