1,804 articles and 14,518 comments as of Wednesday, January 5th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint (Joel Oleson) content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Monday, May 17, 2010

SharePoint: Implementing a Custom Navigation Scheme across Multiple Site Collections for the “Non-Developer”

Guest Author: Jay Simcox
The SharePoint Mechanic

Recently I was fortunate enough to have submissions to SharePoint Saturday in Atlanta and Huntsville accepted. What follows is basically a written version of those presentations. I had started this some time back and had never gotten around to finishing it and because I bricked recording the session in Atlanta and couldn’t record in Huntsville I figured the least I could do was to set it all out in writing. Interestingly enough Peter Allen posted a great ARTICLE on the same subject with a different solution, think of this article as the “non-developers” counterpoint.

Microsoft has made great improvements in the SharePoint suite of products over the last several years. There is one area however that needs to be improved that they seem to be ignoring for some reason. I know that making dramatic improvements in SharePoint navigation isn’t as sexy as bringing in better permissions management, more robust reporting, new services that leverage Access, Excel and Visio but the fact of the matter is if your navigation sucks or is difficult to use your users will do all they can to get out of using your shiny new SharePoint portal no matter what version it is and what other features it may offer.

If you’re like me and are a true “Non-Developer” you have may have taken the time to do some reading and research regarding “Web Usability”. One of the keys that I have seen in both the books I have read and websites I have viewed is setting up a navigation scheme or structure that is consistent across the breadth and depth of your site. I personally think that this should apply to SharePoint as well and Microsoft has let us all down by not addressing the ability to easily implement a consistent navigation structure across multiple site collections.

Note that I said “easily”! If you have an architecture that has site collections with nothing but sites under the top level you could probably claim that you were able to easily set up a consistent navigation scheme. But what about those architectures that have a site collection at the top level and then have a mixture of sites and site collections that falls underneath that top level? It isn’t so easily done then.

The Problem

You have built out your environment following best practice guidelines to keep your content databases under 100GB by implementing multiple site collections. Unfortunately as part of your architecture you have identified a number of functional areas that really don’t have a requirement to be a site collection but that should fall under a top, or secondary, level site collection that might have multiple sub site collections under it. Consider the following example:

Your architecture consists of 4 top level “containers” (besides the Home site) each of which is a site collection. They are:

  • Offices – This site collection consists of your corporate offices and it is pretty much a given that all the users in this group are going to use SharePoint for is calendars, some tasking and minimal document management. There is no way that any of the sites under the offices site collection will need to be a separate site collection.
  • Divisions – This site collection consists of your organizations divisional offices. In the course of the requirements gathering process you have determined that at least two divisions are going to heavily use SharePoint and that there is the potential for a large amount of content to be generated in the sites for those divisions. On the flip side of that you also determine that at least two divisions will not use SharePoint heavily and can be housed as sub sites of the Divisions site collection.
  • Products – This division is designed to support the business process surrounding your company’s products. Two products will generate a great deal of content for storage in SharePoint while two products are no longer in production and the sites supporting them will be used only for sustainment purposes and thus will not generate a significant amount of content.
  • Support – This site collection is designed to house 3 support locations for your company only one of which, Graphics Support, will generate a significant amount of content and will require its own site collection. 

So how do you build a navigational scheme that works across all site collections, sites and sub sites that is consistent?

That’s the situation I recently ran into and while the initial answer sounded pretty simple, build a custom site navigation solution; this was anything but the case (well for me anyway). There’s a lot of information on the internet about doing this but most of it is either incomplete, assumes you know something you don’t or requires programming/scripting skills (something I do not have).

What follows is documentation of how I solved this problem. I will:

  1. Lay out the framework of the solution I came up with.
  2. Identify to you the drawbacks of this solution.
  3. Identify to you the benefits of this solution.
  4. Provide step-by-step instructions on how to replicate my solution complete with screenshots.

The Solution

When I started looking into solutions for the problem I was facing I came up with three potential choices:

  1. Configure navigation manually – there are at least 2 disadvantages to this choice:
    1.  The sheer amount of administrative overhead involved.
    2. Designed behavior on the part of SharePoint where in those sites where you have the Publishing feature activated SharePoint will display a tab for the site you are working in to the direct left of the home tab in your global navigation tabs. You can hide that using CSS but you really shouldn’t have to worry with it.
  2. Write custom code to leverage an external data source – if you’re a developer or have scripting skills this would be the way to go. A couple of the most obvious data sources to use would be a SQL database or a SharePoint list. Personally I think if you leverage the SharePoint list you’ll find that managing your site navigation might be simpler because you could delegate the ability to add sites to your site administrators.
  3. Create a custom XMLSiteMapProvider – this is the solution I have come up. We will use a custom site navigation provider that reads the portal structure from an XML file stored in the _app_bin folder and renders that structure to a custom master page.

The steps we are going to follow to implement our solution are:

  1. Create an XML sitemap file.
  2. Edit the web.config file of our website to enable the use of our new sitemap.
  3. Make 5 changes to the default.master page of our site collection.
  4. Create a custom feature that will allow us to activate our customized master page on any site collection in our farm.

The Drawbacks

As with any solution or fix there are going to be drawbacks, some of the most obvious drawbacks to the solution I am proposing follow below:

  1. Links in the navigation menus are not security trimmed.
  2. The sitemap file is not dynamic. Anytime you make a structural change to your portal (add a new site or site collection you want included in the navigation scheme) you’ll need to update the sitemap file manually. In environments where there is rigid configuration management controls in place this could be problematic.
  3. Implementation of this solution requires access to your SharePoint web front ends. This may also be an issue in those environments where access is tightly controlled.
  4. The web.config file for the web application you are applying the solution to will have to be modified. If you have multiple front ends or have extended your web application you will have to maintain multiple instances of the file.
  5. Customizations will not apply to pages in the /_layouts/ directory which uses application.master rather than default.master. Modifying application.master is NOT supported by Microsoft.
  6. This solution is not exceptionally scalable. It works well for those environments where you might have 20 – 30 site collections.

The Benefits

As there are drawbacks there are also benefits to any proposed solution:

  1. One consistent navigation scheme across your site collections and sites.
  2. No .dll to be deployed to the GAC.
  3. Minimal coding.
  4. Can be extended to modify the quick launch.
  5. Navigation the way you want it and not the way that SharePoint thinks you should get it.

You’ll have to determine if this solution is viable for your environment and/or skill set.

Step-by-Step Instructions

Create the XML sitemap file.
The sitemap file is simply an XML file that consists of three components; an xmlns reference, a group of sitemap nodes or elements and within each node (element) several attributes.

Let’s take a look at the components of the sitemap file:

  1. siteMap xmlns – a reference to the sitemap schema at Microsoft.com. This file defines the elements that can appear in the sitemap file and the attributes that can be associated with those elements.
  2. siteMapNode – the siteMapNode defines the navigational element, tab, dropdown or flyout, of your SharePoint architecture.
    1. Keep in mind that like HTML all of your XML elements must be “closed” for example where you have a <siteMapNode> you must also have a </siteMapNode) closing element somewhere in the file.
  3. Element attributes:
    1. Title – kind of obvious that this would be necessary. This will be the test of your link in the tab, dropdown or flyout(s) of your navigation.
    2. Description – optional and it would probably be good to include attribute. Briefly describing the site here would be beneficial to any person assuming your duties at some point in time.
    3. URL – required, relative url’s do work here and using them to me would be a best practice. I try and use relative url’s anywhere I can as a matter of practice.

The following screenshot shows a portion of my siteMap code. I have provided a .zip file at the end of this article that contains the siteMap file as well as all other components of the solution.


Save the file as mainMenu.sitemap in the _app_bin/ folder of Inetpub on your SharePoint server. You could also store the file in the _layouts/1033 folder in the 12 hive if you so desired.

Adding a child node to your navigation scheme.

Inevitably somewhere along the line you are going to add another site collection or site to your farm that also needs to be added to your navigation scheme. As I mentioned one of the drawbacks to this solution is that is not dynamic. So it will be necessary to edit the sitemap file you’ve created and add a reference to your new site collection or site.

  1. Start by finding the parent node in your sitemap file.
  2. Remove the trailing forward slash in the siteMapNode element
  3. Add a child element directly under the parent.
  4. Close the child node siteMapNode element with closing forward slash />

For example if I wanted to add a site for Requisitions under my purchasing Department node I would alter my code as follows:

Before


After

Don’t forget, it is absolutely critical that you close the child node siteMapNode with the trailing forward slash as shown in the screen shot.

Now that the sitemap file has been created where to store it? By default SharePoint uses a layouts.sitemap file that is stored in the _app_bin folder of your SharePoint servers virtual directory in Inetpub. That is where we are going to store our custom sitemap file. I have seen where some people will store their custom sitemap file in the _layouts\1033 folder. This will work as well as the _app_bin folder. I have looked to see if I could find the benefits of one over the other but couldn’t find any kind of concrete evidence that would lead me to believe that one option was significantly better than the other. Maybe one of the web folks here could chime in with their .02 on that.

Edit the web.config to reference our custom sitemap

With our sitemap file created and saved to the appropriate location we’ll move on to adding a single line of code to the web.config file of our SharePoint server. This line of code will tell SharePoint the name of our custom sitemap, where to find it, what “type” or class the custom sitemap provider is using, what version, the culture, and the PublicKeyToken.

Locate the web.config file in the virtual directory of your SharePoint server and take the following steps BEFORE you do anything else.

  1. Right click the web.config and copy the file.
  2. Right click and paste your copy of the web.config back into the virtual directory. This will create a file named “Copy of web.config”

Open the web.config with either Notepad, Visual Studio or Notepad++. Never, ever, use Wordpad to edit the web.config. Wordpad has a lamentable tendency to replace certain characters in your web.config with question marks (?) which tens to break things and can be extremely frustrating and time consuming to fix.

  1. Find the siteMap node in the web.config. It should be about line 156 and will identfiy the default siteMap provider of your SharePoint portal.
  2. Directly under the <siteMap defaultProviders line you’ll see a <providers> node. Just before the </providers> closing tag add the following line of code
  3. <add name="CustomXmlContentMapProvider" siteMapFile="_app_bin/mainMenu.sitemap" type="Microsoft.SharePoint.Navigation.SPXmlContentMapProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  4. Save your changes.
  5. Restart IIS.

The line we are adding tells SharePoint that there is another sitemap provider available, it’s name, and where the sitemap file is located.

Create the custom master page

We need to create a custom master page that will allow us to leverage our custom sitemap provider and to display flyouts off of our drop downs in the global navigation tabs. Note that I did not say “make modifications to the default.master”. Best practice; never edit the default.master, make a copy and make your changes there. This is what we are going to do.

  1. Open your SharePoint site using SharePoint Designer.
  2. Navigate to the default.master page. The path is _catalogs/masterpage/. If, for some reason, one or both of these folders are empty you’ll need to refresh the view. In the toolbar click “View” and then “Refresh”.
  3. Find the default.master and right click > copy
  4. Make sure that you do not have a folder highlighted and then right click > paste into the masterpage directory. You should now see a file named “default_copy(1).master”.
  5. Double click the new file to open it. If you are prompted to check it out click OK to do so.
  6. We are going to make 5 changes to this file.
    1. Switch to code view
    2. Find the SharePoint:AspMenu element in the page. In my page it was about line 113.
    3. Change the “DataSourceID to “mainMenu” which was the name I saved my sitemap file as. Note that you do not include a file extension here.
    4. Next find the MaximumDynamicDisplayLevels element and change it from the default of 1 to 4. This will allow you to display links 4 levels deep. Be aware that taking your navigation too many levels deep can adversely effect your servers performance.
    5. Next find and copy the “SharePoint:DelegateControl” node. Paste the code you’ve copied directly under the </SharePoint:DelegateControl> closing tag.
    6. In the code you just pasted in change the following 3 items.
      1. Change the ControlId to CustomNavigationDataSource
      2. Change the SiteMapProvider to CustomXmlContentMapProvider
      3. Change the id to mainMenu
  7. Save the file to your desktop. I chose to call it MyCustom.master

The following 2 screenshots show the changes along with notes.




Create the feature to implement our custom master page

Lastly we are going to create the custom feature necessary to push the custom master page we just created across our site collections. A feature is simply a small piece of codethat adds additional functionality to SharePoint. The feature consists of at least 2 xml files, feature.xml and elements.xml, our feature will also include a folder called MasterPages.

Take the following steps to create your feature;

  1. Navigate to the features folder in the 12 hive of your SharePoint server \12\template\features\
  2. Create a new folder in the features folder. Call it CustomMasterPage
  3. Within your new CustomMasterPage folder create another folder named MasterPages and add the MyCustom.master master page you just created to it.
  4. Using your text editor of choice create the feature.xml file and add the following:
    1. Feature Id – this is a GUID or Global Unique Identifier. This can be done using Visual Studio or if you don’t have VS you can use GUIDGen.com. Each feature MUST have a UNIQUE identifier.
    2. Title – “Custom Master Pages” this is the title of your feature and is what you’ll see in the site collection features list.
    3. Description – do yourself a favor and add a description so you know exactly what this feature is being used for.
    4. Version – the SharePoint version in this case 12.0.0.0
    5. Scope – this is the scope that the feature will be deployed at. It could be Farm (the entire farm), Site (this is the Site Collection level) or Web (the site level). We’ll do “Site”
    6. Hidden – is the feature hidden or viewable by site collection and farm administrators. You could hide it and activate using stsadm if you wanted to. We are going to leave it viewable.
    7. DefaultResourceFile – my understanding that this attribute references the core.css file
    8. Xmlns – what xml schema is being used.
    9. ElementsManifest – the location of the Elemnts.xml file we will create in the next step.
  5. Using your text editor of choice create the feature.xml file and add the following:
    1. ModuleName – the ModuleName element allows you to add one or more files to a SharePoint website
    2. URL – where the fileis going to be added, in this case _catalogs/masterpage
    3. Path – the location where the file is located within the file system
    4. RootWebOnly – should the file or page only be available in the root SharePoint site. In this case no.
    5. File Url – your filename in this case MyCustom.master
    6. Type – GhostableInLibrary this specifies that SharePoint store the file in a Document Library.
  6. Now that the files have been created you will need to use stsadm to install your new feature. From the command prompt run the following command:
    1. Stsadm –o installfeature –name custommasterpage
    2. I always run an IIS reset as a matter of practice after I have done anything using stsadm.




Provided that your fetaure has installed correctly when you go to your SharePoint site and navigate to the Site Collection Features link in your Adminitrative UI you should see “Custom Master Pages” as one of your features. Click the “Activate” button to activate the feature (you could do this using stsadm as well if you wanted to).


After the fetaure has been activated go back to site settings and then click on Master page. Click the drop down and you should now see MyCustom.master as an option. Set both the Site Master and System Master pages to MyCustom.master and click “OK”.


Navigate back to the main page of your site and you should now see your custom navigation.

Navigation before our changes


Navigation after our changes


And that’s all there is to it. Now someone is going to say that this isn’t really a “non-developer” solution, I would argue that to a certain extent. It’s just my opinion but every SharePoint Administrator should have the ability to write some basic XML and that’s really all we have done here. One note; don’t forget XML IS CASE SENSITIVE and are the cause of most of the errors I saw when working through this solution.

Now, is this the right solution for you? Well, I think the answer there is the standard SharePoint answer when you’re taking about capabilities or requirement solutions; “It all depends”. I think that for a small to medium environment that this solution would work well. If you’re managing a large environment that has several hundred site collections and/or sites I would strongly suggest you look into the solution that Peter covers in his article. My requirement was complicated by the fact that I am not allows to take code, scripts or any kind of .NET code, off the internet and implement it without going through a long drawn out vetting process. Add to that my obvious lack of programming skills and you see what I came up with.

I hope you’ve found this solution at least interesting and hopefully usefull. If you have any questions please don’t hesitate to ask!

As promised here is a link to a .zip file that has the custom master page, my feature files, the mainMenu.sitemap file and a copy of my web.config. While you can add my custom master page to your implementation don’t try to replace your web.config with mine. Use mine as a reference.

Consistent Navigation Files

Until the next time…

Guest Author: Jay Simcox
The SharePoint Mechanic

Jay Simcox is a SharePoint Architect/Administrator currently disguised as a “Programmer III” for his current employer. Jay has been supporting and managing Microsoft technologies for 10 years with the focus of the last 7 years being SharePoint. With his background in end user training, support and network administration Jay focuses on finding those “no-code” solutions that all “Non-Developers” working with the SharePoint platform crave, developing and providing training for his end user community and sharing his knowledge with as many as he can.

 

Please Join the Discussion

49 Responses to “SharePoint: Implementing a Custom Navigation Scheme across Multiple Site Collections for the “Non-Developer””
  1. Becky Lash says:

    Great article! Thanks, Jay!

  2. Smriti Singh says:

    Hi,

    Very helpful article.I was able to build my custom navigation using this.

    Would like to know how to set relative path’s in .sitemap file. I have a node which references to a different site collection.
    using ../../sites/home/default.aspx gives an error.

  3. Bob says:

    Hi,

    Wonderful article. I don’t need to build out across multiple sites, but have a requirement to build navigation for a relatively large site with about 60 pages of content, libraries, lists, etc..

    I’d like to make a drop down navigation scheme that leverages this solution. I can build out the site map, but will this work only on single site?

    The structure is http://sharepoint.domain.com/sites/company/ProjectOffice/default.aspx
    there are multiple sites for our Company. The example here is the project office.

    Any ideas?

    Thank you

    Bob

  4. Justin says:

    Great article, thanks for the help. Quick question though. Is there a way to carry this over to pages like ’site settings’ or ‘view all site content.’ I have the XML navigation working but whenever I go to site administration, view all site content, etc.. it goes back to the old navigation.

    • Jay says:

      Justin I believe you would have to edit the application.master which as I understand it is not supported by Microsoft. That being said it probably isn’t that much different than editing the master page.

  5. Lindsay says:

    Hi Jay

    How would I go about hiding in CSS the global nav item that SharePoint puts on the left for the sites with Publishing enabled? Would this method just hide it and leave a blank space or would the nav all shift to the left?

    Thanks for your help!

    Lindsay

    • Jay says:

      Lindsay,

      This solution would replace the navigation tabs so what you’re seeing wouldn’t be an issue. That being said if you were to go with a manual configuration you could hide that first tab using the following css

      #zz1_TopNavigationMenun0 {
      display:none !important;
      }

  6. Kevbo says:

    This solution works great for SP2010 unless you can’t use relative URLs. I need to link to other site collections and web apps but entering an absolute URL causes SP2010 to just link back to the current site collection? Haven’t found a fix online yet or know what to try :(

    • Jay says:

      Not sure why relative URLs wouldn’t work in 2010. I know they do work in 2007 and I had actually replicated this article using 2010 just haven’t documented it. As part of that replication, and as part of this article I used relative URLs in the sitemap xml file.

      Biggest key to using relative URLs is to make sure that you have the correct path.

      When I get some time I’ll do this article for the 2010 platform although I’ll tell you that Peter Allens solution using jquery and the two custom lists is probably easier to manage if you are able to implement it.

      - Jay

      • Kevbo says:

        Hey Jay,
        Thanks for the reply. Sorry I didn’t clarify myself properly, only relative links work in SP2010 with this solution. If you try to use an absolute link the link breaks and just points to the root of the current site collection you are on. So if I try to add a link to my document center at http://docs, it will not work which stinks since I can’t use relative links to get to other web apps and site collections (at least not that I know of…)

        It seems that many others are having the same issue as me. It will work in 2007 but not in 2010, someone mentioned they may have changed the way the SiteMapProvider works. All absolute links break and just show up as an empty ” ” in the source code which is why they just point to the root of the current site collection you are on. I’ll update here if I find any answers and let me know if you find anything as you do the 2010 article, thanks!

        I agree that Peter Allen’s solutions looks great but I am trying to avoid scripts and jquery if at all possible.

  7. Jay says:

    Across site collections should work with relative links, I know I did that in my 2007 demo and I am pretty sure I replicated it in 2010. I’ll go back and take a look and see if I can do it again.

    As for web applications that’s a different story. I would expect that they would require an absolute path. That being said I don’t know why it wouldn’t work in either version. I’ll look at that as well and will post my findings.

    - Jay

  8. Jay says:

    Kev,

    Here’s what I’ve figured out so far.

    1. You’ll need to make the following changes to the files I provided in order for this solution to work in SP 2010.

    web.config and feature.xml:

    change the version from 12.0.0.0 to 14.0.0.0

    Master page under SharePoint:AspMenu (around line 343 in my custom master page):

    set DataSourceID to mainMenu (same as your custom sitemap file)
    Set MaximumDisplayLevels to 4

    Copy the SharePoint:DelegateControl code block and paste it directly under the closing tag (around line 366 or so).

    In the code block you just pasted in make the following changes:

    ControlID = “CustomNavigationDataSource”
    ID = xmlNavigationDelegate” (this one is very important as it does not exist in a MOSS 2007 master page).
    ShowStartingNode = “True”
    SiteMapProvider = “CustomXMLContentMapProvider”
    id = “mainMenu”

    remove the entry for “StartingNodeURL=”sid:1002″

    That’s all for the changes to the master page.

    If you make these changes you should be able to implement this solution and navigate across site collections using relative URL’s. I have tested that and kow it will work.

    For navigating across multiple web applications I have an idea how you might be able to make it work but don’t know for sure if it will work or not. I’ll have to do some research and a little learning about SP2010 and try it.

    I’ll try and do an article on both specifically implementing this in SP2010 as well as how you might be able to work across web apps.

    Hope that helps some.

    - Jay

  9. Kevbo says:

    Wow thanks Jay for looking into this, I really appreciate your time and effort!
    I didn’t have the ‘xmlNavigationDelegate’ which probably explains why I had to just remove the DelegateControl for it to work in publishing sites previously. Now using your up to date steps, I have it ‘working’ in publishing sites with the DelegateControl and settings you specified.

    As far as relative links to other site collections, I’m still not able to get this working. I must be doing something wrong but just in case anyone else is doing the same thing, let me clarify with an example.

    I have 3 site collections with the following URLs:
    http://home
    http://home/SC1
    http://home/SC2

    So in my sitemap xml I have specified 3 links:
    title=”Home” url=”/”
    title=”SC1″ url=”/SC1/”
    title=”SC2″ url=”/SC2/”

    If I look at the navigation from the ‘Home’ site collection, everything works fine with relative links. However once I navigate to any other page or site collection the relative links append to the URL of the site I am currently located (which is how relative links work, i think). So when I go to the SC1 page the links on the nav look like this:

    Home: http://home (this link always works regardless of what site or site collection I am on)
    SC1: http://home/SC1/SC1 (it adds SC1 to the link which leads to a site that doesn’t exist)
    SC2: http://home/SC1/SC2 (again it just adds SC2 to the end of the link of the current site)

    Here is how the links look from the SC2 site:
    Home: http://home
    SC1: http://home/SC2/SC1
    SC2: http://home/SC2/SC2

    This is why I wanted to use absolute links, but they don’t work at all and just end up pointing to the root of the site you are currently located at when looking at the nav. Looking at the source code of the page shows the url is being read as blank (’ ‘) which is why it points to the current site you are on.

    I apologize if I am making a simple mistake here, is there some other way I should be coding the relative links so they work on all sites and site collections? Right now they just append to the end of whatever URL I am currently at which doesn’t work. If absolute links worked then that would be the answer to my problem and allow me to link to other web apps, but I am not sure why they don’t work :(

    *Hope I’m not missing something simple and being a complete fool :)
    Thanks again for all your help!

    • Jay says:

      Haven’t forgotten about you kevbo. I’m going to try and look at this sometime in the next couple of days. I just have a lot going on right now and with the broken ribs just can’t sit at a desk for long periods of time like I usually do.

      It seems like I have seen this somewhere while I was working through making this work. I just don’t remember what caused it.

      As soon as I have something I’ll post a response.

      - Jay

    • Jay says:

      kev,

      Looked at this a bit over the last week or so and am seeing the same behavior you are where the links append to themselves. No answer yet but I’m still looking.

      As for using absolute URLs no progress yet.

      Jay

      • Jason C says:

        Does the absolute URL issue have to do with getting an error when replacing the following link:

        /sites/subsite/

        with

        /site/subsite/Page%20Library/page.aspx?

        Because that is one issue I cannot get past.

  10. Patrick says:

    Hi Jay,
    When will you have the SP 2010 atricle posted?
    Hope soon.
    Thanks

    • Jay says:

      Hey Patrick.

      Unfortunately it won’t be as soon as I’d like to have it but I will get to it. Right now I have a huge deliverable due next week and have been really pushing to finsh that. Combine that with a fall I took a couple of weeks ago where i broke some ribs and I am now way behind on everything I have on my “to-do” list.

      That all being said I have two articles n various stages of completion and hope to work on the navigation in 2010 article after I get back from the Best Practices Conference next month.

      - Jay

  11. Kevbo says:

    No problem and thanks for looking into this Jay!
    Hope you heal up quickly and get back on top of your ‘to-do list’.
    I’ll check the site from time to time but please put me on the back burner and get yourself healthy and back on target first :)

  12. Patrick says:

    Get well soon and all the best Jay

  13. Jay G says:

    Hi jay,

    Great article.
    I was able to install custom master page feature then applying it to site collection getting an unexpected error.
    any helpappreciated.

  14. Jay G says:

    Hi Jay,

    I did make change in Web.config file getting the below error message.
    Could not find the sitemap node with URL ’sid:1002′.
    I checked the site map node url and i didn’t see anything wrong.

    Appreciate your help

    • Jay says:

      Jay, try removing the reference to sid:1002. As I recall I left that particular line of code out when I did this.

      Let me know if that fixes the problem.

      - Jay

      :-) I feel ike I am talking to myself!

      • Jay G says:

        Jay,

        After removing sid id, It did work well. Thanks for all your help.
        I have another question, how can we get sharepoint groups inherit from one site collection to another.

      • Jay says:

        Jay that’s one of those things I am 99% sure you can’t do. One of the reasons that we create multiple site collections is to create hard security boundaries. I agree it can be a pain but it probably isn’t a real bad thing IMO.

        - Jay

  15. Smruthi says:

    This is really a great article. Thanks for your help

  16. Kevbo says:

    Thanks Jay for the update.
    I’ve been focused on other parts of my SP2010 rollout but its good to hear that you are having the same issue since it proves I’m not crazy or doing something silly/wrong :)
    I fear it may not be fixable but that may just be my pessimistic side coming through!
    Stinks since this is such a great solution otherwise…. hope your back in good health!

  17. Patrick says:

    Anyone implemented it for SP 2010?
    Hope you are back and well Jay?
    Chrs

  18. Jay says:

    Hey Patrick!

    I am back and doing much better thanks. Actually had the opportunity to tweak this article a little and present it at the Best Practices Conference last week. I’ll be posting the slide decks and an updated version of the article in the near future. I’ve removed the portions regarding creating a feature and replaced it with using designer to import the custom.master.

    Regarding 2010, I am going to revisit this over the next week and see if I can identify the cause of the issue that kev and I have been seeing. Hopefully I can fix that for us. I’m pretty sure it’s something in the master page but don’t know 100% for sure.

    Hopefully I have the answer in a day or so.

    - Jay

  19. Tim says:

    Hi Jay,

    I was wondering if you could update us on the issue you were working on with Kev? I am having the same issue (for 2010) and am flailing over this. I am basically attempting to recreate the global navigation that you see in http://sharepoint.microsoft.com. However, I cannot get the menu control to render links to my other site collections beyond the primary site collection. In other words, if I open my site at the primary site collection (initially created during install), then the top navigation is correct (links and all). If I click on a different site collection link, I get there fine but the top navigation links for this site collection are now appended (with current location).

    Thanks so much for your article. As others have stated, it is comforting to know that there are other people out there experiencing the same issue.

    Kind Regards,
    Tim

  20. Jay says:

    Hey Tim,

    I have not been able to solve the issue yet. As I understand it (and I have not been able to verify this due to time constraints) in order for this to work in 2010 you’ll have to create a custom delegate provider which is way beyond my capabilities.

    That being said I think if you’re trying to replicate the navigation you see at sharepoint.microsoft.com you might have better luck using jquery and Peter Allens solution documented elsewhere here. To be honest I like Peters solution better than mine, it’s much easier to manage because it’s driven by lists rather than an xml file on the server. I think the only thing you’d really have to do to match what Microsoft is doing on their site is figure out how to display your submenus horizontally as opposed to vertically. Because I don’t write script that would be difficult for me personally to do For others that do it might not be.

    Sorry I can’t be more help than that.

    - Jay

    Peters solution – http://www.endusersharepoint.com/2010/05/21/sharepoint-a-global-navigation-solution-across-site-collections-%e2%80%93-version-2-0-solution/

  21. Tim says:

    Hi Jay,

    Thanks for the update. I will continue to work on this. I really need a solution to this for many clients we are beinging 2010 implementations for. I know they are going to want this cross site functionality. I have to admit disappointment in MCSFT in not integrating the cross site awareness in navigation as they have in BCS. A real shortcoming in my opinion.

    I tried Peter’s solution in SP 2010 but could not get the navigation to render. I may try again since it was really late when I tried his solution.

    Anyway, thanks so much. Once I have successfully implemented a navigation rendering like sharepoint.microsoft.com I will update this list as well. I am sure there are people out there trying to do the same thing. This format in navigation is growing in popularity.

    Sincerely,
    Tim

    • Patrick Ige says:

      Hi Tim,
      I have implemented some mega dropdown menus using data from a list and Jquery.
      As Jay mentioned try downloading Peters solution and try to implement the same in Sp 2010.
      Follow the link below and in the thread i have posted a full code(I used the jquery superfish plugin).
      http://spservices.codeplex.com/Thread/View.aspx?ThreadId=226965
      Send an email to me at [email protected] and i would let you know when i blog it.

    • Jay says:

      I had an interesting conversation regarding the lack of cross site collection navigation at SharePoint Saturday – Atlanta a few months back. The point was made that it’s possible that MS left that functionality out to give ISV’s an opportunity to develop a product to fill the gap.

      I thought it wasan interesting take on the issue and in reality it probably isn’t wany poutside the realm of possibility.

      regarding the actual navigation try looking at the following link and see if it doesn’t give you some ideas on what you can do for your implementation. As I said in the article my solution does not scale exceptionally well unless you’re willing to invest in the time required to write the XML.

      Personally I like Peters solution because I don’t have to have server access although it is a little slow to loa din my environment sometimes.

      http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/

      - Jay

  22. Kevbo says:

    Thanks Jay for looking into this, from my research I had a feeling it would require a custom delegate provider. Our company’s needs have changed and I have been looking into ‘mega drop downs’ similar to the one used for Kraft’s sharepoint site.

    Thanks Patrick Ige for your link, I didn’t realize you can use a Data View Web Part for the navigation?! I’ll have to play around with that but I have a feeling I’ll just end up using JQuery and some form of Peter’s script.

    Thanks again all for sharing the knowledge!

  23. Brad says:

    Can you post your SP 2010 custom master page? I’m attempting to reproduce it and get the relative urls working between site collections but have been unable to get it working. I’m hoping by viewing yours I can tell what I’m doing wrong.

    Thanks
    Brad

    • Jay says:

      Brad,

      This is a MOSS solution. As I understand it you’ll have to write a delegation provider to do anything similar in SP 2010.

      Patrick has posted a link higher up in the thread of discussions that you may find helpful.

      -Jay

  24. Akish says:

    i have implemented custom navigation for my sharePoint portal using above mentioned way.
    i am able to get this navigation on my root site.
    But when I drill down to sub-sites in the portal it does not take the my custom-navigation from master, instead of inheriting the master from parent.

    Please help.

    • Jay says:

      Akish,

      Make sure your sub-sites are using the same master page as the parent. If they aren’t then the navigation will not inherit because the master page being used doesn’t have the necessary changes made to it.

      Take a look at the master page settings in the administrative UI and go from there.

      Let us kno wif that fixes the problem for you ro not.

      - Jay

  25. Nick Kellett says:

    Great article Jay, it really helped me. If you are having problems with absolute links not working in subsites or other site collections (as I did) then you should not use the SharePoint SPXmlContentMapProvider but instead use the default asp.net xml sitemap navigation provider…put this in your web.config instead:

    add name=”StoneShareXmlContentMapProvider” siteMapFile=”/_layouts/1033/web.sitemap” type=”System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” /

    • Akish says:

      Hi Nick,
      Can you please provide the steps regarding the changes you have made for absolute links issue for subsites and site collections.
      It would be a great help for me.
      Thanks.

      • Nick Kellett says:

        Hi Akish, Jay’s instructions are spot on – the only change to make is to use the xml sitemap provider code I gave in the web.config, instead of the sharepopint equivalent. That should fix your problem. Again the only change is in the web.config sitemap node.

    • Jay says:

      Thnaks Nick, glad it helped you out. Also, thanks back to you for the great tip on changing the sitemap provider!

      - Jay

    • Bjorn says:

      This menu works very nice in SP2010, up to the point here you are in a site collections, then the url is wrong, doesn’t go one level back, except for the home page link.

      If have replaced with what Nick posted here, nothing changes. Also, I don’t have web.sitemap in layouts/1033 folder.

      Has someone got this working for site collections in SP2010.

      • Bjorn says:

        Got it working, in web.config, you leave the SPXmlContentProvider as is, and you add your CustomXmlContentMapProvider as above, but like this:

        add name=”CustomXmlContentMapProvider” siteMapFile=”_app_bin/mainMenu.sitemap” type=”System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”

        Now my urls are perfect within a site collection, and I can link to extrnal websites as well.

  26. Matt Huber says:

    Thanks Nick, that worked for me!


Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!