views:

2277

answers:

3

I’ve been trying to find a way to extend SharePoint breadcrumbs across multiple site collections, and I’ve been unable to find a way. I can set the portal site connection setting on the site collection to link to its parent site collection. But, that will not show only one parent site collection. Here’s an example of the type of setup I’m looking at creating.

The root site, Intranet, has a managed path called sites. Under sites there is site collection called HR located at /sites/hr/. Under HR there is another managed path set up called outreach. In outreach there is a site collection called Recruiting located at /sites/hr/outreach/recruiting/. Thus when a user is in the recruiting site, I want them to see Intranet > HR > Recruiting as the breadcrumb trail.

Example as sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"&gt;
    <siteMapNode title="Intranet" url="http://intranet/Pages/Default.aspx"&gt;
 <siteMapNode title="HR" url="http://intranet/sites/hr/default.aspx"&gt;
      <siteMapNode title="Recruiting" url="http://inranet/hr/outreach/recruiting/default.aspx"/&gt;
     </siteMapNode>
    </siteMapNode>
</siteMap>

Setting the portal site connection on recruiting I can get HR > Recruiting when you’re in recruiting and setting the portal site connection on HR I can get Intranet > HR when you are in the HR site. I can’t though.

I’ve tried using the SPXmlContentMapProvider to read the sitemap file, but I’ve been unable to get that to display at all when I set that as the SiteMapProvider for the SiteMapPath of GlobalNavigationSiteMap in the default.master. (GlobalNavigationSiteMap is the SiteMapPath that creates the bread crumbs at the top of the site). The same architecture works well however on a generic .NET application, but does not seem to work in SharePoint. I’ve also properly registered the sitemap as a defaultProvider and been able to use it to replace the TopNavigationMenu. (TopNavigationMenu is the global navigation menu/bar of buttons at the top of the default SharePoint layout).

Is there a way to actually build this functionality into SharePoint?

A: 

Why are you using a seperate site collection for each subsite?

Jason Watts
The sites will be managed by different users, and different people will have permissions over them. In my example, I kept it simple, but what is actually being sett up has a lot more complex set of permissions and access. We're also planning to use more site collections to help managed site collection size.
ICodeForCoffee
Not sure if you've already taken a look, but sahil has a great article on this:http://blah.winsmarts.com/2008-1-Implementing_Consistent_Navigation_across_Site_Collections.aspx
Jason Watts
I have actually. That is where I ran into the problem of not getting the SPXmlContentMapProvider to work when I used it to drive the breadcrumbs at the top of the default SharePoint template, the GlobalNavigationSiteMap.
ICodeForCoffee
+2  A: 

Since you are implementing a custom masterpage (or customizing the default one), why not replace the breadcrumb control with your own? Or make a custom sitemap provider if you need to combine your sitemap with Sharepoint's generated map.

Øyvind Skaar
I've not tried building a custom SiteMapProvider. That would be a fairly intensive process I would imagine, but if you get it done right, would work. Any suggestions about how to go about that approach?
ICodeForCoffee
Try this: http://msdn.microsoft.com/en-us/library/cc789625.aspx
Øyvind Skaar
A: 

I've thought a lot about why you can't use SPXmlContentMapProvider and I think it comes down to how SharePoint renders and uses managed paths. My theory is this:

All of the site collection locations in SharePoint are managed paths. Since the content is really stored in the database, and while IIS presents the information like it's in a folder, the pages aren't located in folders. Instead the location is somewhere in the "ether" of SharePoint and whatever location SPXmlContentMapProvider see's itself being in, it's somewhere else then the entries in the xml file. Now the Request.Url does know where you are, but that information does not appear to being presented to the SPXmlContentMapProvider.

I have also come up with a work around for the problem. You could manually edit the master page for each site collection to stick the breadcrumb trail for that site collection in front of the GlobalNavigationSiteMap. Thus, each site collection with this navigational requirement would then need to have it's own custom master page. It's an ugly, brute force way of doing things that I have no intention of implementing. It would work, but would be a maintenance nightmare.

ICodeForCoffee