Thursday, October 23, 2008

Customizing SharePoint Top Navigation Menu and Quick Launch Bar

Customizing SharePoint Top Navigation Menu and Quick Launch Bar has been a request from a couple of different sources. So I've decided to finally post on the logic, step and simply value changes to accomplish this. You will need a text editor for editing the master page and/or pages. For this I'll be using SharePoint Designer.


Goal:


Essentially you want to keep your main portal page clean and you want the "fly-away menu" look and feel. This is a major advantage with SharePoint 2007 and the Security Trimming. Depending on how many levels you want to show will determine your overall look and feel. Remember that you can look under your Manage Content and Structure under Site Actions to look at this tree and understand your levels. 0 (zero) is Home, and everything incrementing from 0 (zero) will allow for additional sub sites to be displayed.


Prep Work:

Under Site Action > Site Settings > Modify All Site Settings you'll see "Look and Feel". From here you're looking for Navigation. Under Navigation make sure that "Show Subsites" is checked.



NOTE: It is VERY important to make a copy of this original file > Default.Master . Changing the master pages can cause a lot of headaches for you and your portal, if not done correctly. I'd recommend even downloading a copy to another location for safe keeping. You can use version control, but I'm still recommending.


Use the breadcrumb to get back to Site Settings and under "Galleries" you are looking for Master Pages and Page Layouts > default.master.



Editing:


Find default.master and select "edit in Microsoft Office SharePoint Designer" or which ever editor you have installed.



First you're going to be looking for : "TopNav"

And more specifically 2 separate lines for editing:

StaticDisplayLevels="2"

MaximumDynamicDisplayLevels="1"


This is where the values determine the depth and width of your menus. The StaticDisplayLevels will determine how many levels in your site collection you wish display on the top ribbon and how wide you want it to be. For example, if you have "Home > Sites > Team Sites > Sub Team Sites > Sub Sub Team Sites" and your StaticDisplayLevels was set to 3 you would show everything up to "Team Sites" across the top. If you set your StaticDisplayLevels to 1, you would only show "Home". You can play with your changes and test. Just make your value change, save and then refresh your browser.


Second you're looking for: "QuickLaunch"


Same rules apply here but you're working on the horizontal expansion rather than vertical. You still have your same fields but your default values are a little different.


StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="0"


Things to be aware of:


Security trimming does still apply here. If you can't navigate through a site you don't have access to. This translates to if you have access to sites #1, #2 and #4, your navigation will only show #1 and #2. You can't traverse through #3 to get to #4 so the menus will not show #4.

No comments: