2012 Illinois Technology Association - CityLights Finalist

BLOGS

MPS Partners provides functional and technical expertise and insights into business process management trends and Microsoft technologies.

Contact Us
HOT JOBS
Interested in reviewing our current job openings or submitting a resume?
CLICK HERE
Home » Blog » SharePoint » SharePoint 2010: Custom Global Navigation – Design (1 of 3)

SharePoint 2010: Custom Global Navigation – Design (1 of 3)

This Blog is broken up into three parts:
  1. Design
  2. Code (Future Topic)
  3. Implementation (Future Topic)

Overview

 

Recently I had a project that required a custom global navigation.  The client has the requirement to provide a Global Navigation in the banner of their SharePoint site that allowed users to navigate to various Sites across Site Collections & Web Applications.  The trick is they wanted to rely on the underlying SharePoint site security to control what a user saw in the navigation, for example if I have access to 5 sites and you have access to 3 our respective navigation’s when we log in should only display what we have access too.

 
This is only a rough overview of the Global Navigation I implemented but it should be an interesting highlight of key points that should kept in mind if you ever need to design the same.
 

Background

 
To understand what I’m discussing here will require a little background.  This SharePoint project was to implement a collaboration portal for the intranet.  The portal was broken up into several components:
  • Projects
  • Communities
The Project were sites broken up by type into various site collections (Internal, Customer, etc.), and each community was a site collection.  Other implementations that you can think of may have different names and alternate Site Collection / Site hierarchies but this is was the architect of the project designed for me to work with.  
 

Requirements

  • Centrally Managed
  • Globally Accessible by the entire Farm
  • Display of menu elements must be controlled by SharePoint site permissions
  • Configurable without the redeployment of code
  • Multiple navigation levels (current implementation has 3 levels but supports more)
  • Display the newest X sites and sort these sites alphabetically
  • Separate page to display all Projects/Communities that a user has access too if they are authorized to more than what is displayed in the navigation
  • Must execute efficiently and not impact the overall performance of the site

Example

 
For this post I will be using the following structure as a reference example to make it easier for you to follow.  The sample menu I will be defining needs to contain the following
  • Home
  • Communities
    • Test Community A
    • Test Community B
  • Projects
    • Internal
      • Internal Project 1
      • Internal Project 2
    • Customer
      • Customer Project 3
      • Customer Project 4
Note that the navigation is a simply HTML List (<ul>) of Anchor Tags (<a href="">), Making this actually look like a menu is handled by CSS.
 

Design

 
First thing was to lay out how best to structure the menu itself.  There were three possible different types of menu items that the design had to accommodate:
  1. Static Items – simple link to a URL
  2. List of Sites within a Site Collection that the user is authorized to – Project Sites
  3. List of Site Collections within a Web Application that the user is authorized to – Community Site Collections
Now that this is laid out I designed I had to store the definition of the menu somewhere, as per the requirements this had to be dynamically configured so it could be changed on the fly. To accomplish this I created Content Type and List to store the definition. 
 

Content Type Fields

  • Title – Simply the text to display in the menu
  • Link – The URL to link to when a user clicks on it
  • Type – The different types of menu items that 
  • Query
  • Query Limit
  • Parent Title
  • Selected Prefix

Location

 
Now that we have a content type and list definition the list had to be implemented somewhere.  There was a main "Intranet" site collection that was the main landing spot for the farm so the list was implemented here however the list must be referenced by various Sites, Site Collections, and Web Applications.  To accomplish this we create two Farm properties that were deployed via PowerShell 
  1. GlobalNav Site – the URL of the site collection containing the list implementation
  2. GlobalNav List – the name of the List itself within the Site
There are many other options we considered but for this project this was the best solution we came up with.
 

Web Parts

 
The Code was then broken up across multiple Web Parts, we decided to encapsulate all of the functionality into Web Parts to give us the most flexibility going forward. This will be gone over in more detail in the Code post but from a design standpoint we have:
  • Global Navigation – the global navigation itself that creates the full menu containing all navigation the user is authorized to.  This is referenced in the master pages used throughout the farm
  • My Communities – A simple list of all communities a user is authorized to
  • My Projects – A simple list of all projects a user is authorized to

Final Thoughts on Design

 
It took a lot of work to fully implement this global navigation (as you will see in the following posts) but in the end the client was very happy.  In retrospect there are some things I may have done differently but that’s the case on every project I’ve worked on as a consultant.  The coolest parts of the design are:
  • Definition was all centrally managed via a SharePoint List
  • Projects & Communities that appear in the list were personalized for the current user
  • No custom security was needed, was able to use the SharePoint object model to determine which sites the user was authorized to and displayed only those
  • Everything was rendered via web parts so the client can utilize them however they need in the future
This entry was posted in SharePoint. Bookmark the permalink.

Leave a Reply

Please complete the form below to submit your comment. Your email address will not be published.

Required fields are marked *

*

 
View By Author
  • View By Category
View By Date
Part Of SPR COMPANIES
© 2013 SPR Companies. All rights reserved. About | Competencies | Products | Solutions | Clients | Events & Resources | Careers | Site Map | Legal/Privacy