Wednesday, May 25, 2005

Quick Launch Bar in SharePoint areas

WSS sites and workspaces contains a quick launch bar that by default show all SharePoint lists and listings in a site, provided that they are flagged with 'Display this [list] on the Quick Launch bar' (QLB). This setting is available in 'Modify Settings and Columns' when managing the content of a SharePoint list. It is also available when creating new lists and listings. By default the WSS quick launch bar shows lists in these categories: Documents, Pictures, Lists, Discussions and Surveys.

What has puzzled me for some time is that the quick launch bar is never shown in SharePoint Portal Server 2003 areas, even if I flag e.g. a document library in the SPS area with 'Display ... on the QLB'. So I opened a SPS area with FrontPage 2003 to check if the area contains any code for showing the flagged lists, and the area did not. I had used FP2003 several times before on WSS team-sites to change the QLB, e.g. to remove the 'Surveys' groups header and to add links to other web part pages in the same team-site. So I decided to try to copy code from a WSS team-site to a SPS area. This works fine and is actually quite simple to do.

Start by copying the applicable code for the QLB groups that you want in your area from an existing WSS site, e.g. the 'Documents' group for showing all applicable document libraries:

<table border="0" cellpadding="0" cellspacing="0" class="ms-navframe">
<TR>
<td id="onetidWatermark" class="ms-navwatermark" dir="ltr"> </td>
<TD class="ms-navheader" width="126" style="padding-right: 2px;"><A HREF="_layouts/1033/viewlsts.aspx?BaseType=1">Documents</A></TD></TR>
<TR>
<td id="onetidWatermark" class="ms-navwatermark" dir="ltr"></td>
<TD style="height: 6px">
<!--webbot bot="Navigation" S-Btn-Nobr="FALSE" S-Type="sequence" S-Rendering="html" S-Orientation="Vertical" B-Include-Home="FALSE" B-Include-Up="FALSE" U-Page="sid:1004" S-Bar-Pfx="<table border=0 cellpadding=4 cellspacing=0>" S-Bar-Sfx="</table>" S-Btn-Nml="<tr><td><table border=0 cellpadding=0 cellspacing=0><tr><td><img src='_layouts/images/blank.gif' ID='100' alt='Icon' border=0>&amp;nbsp;</td><td valign=top><a ID=onetleftnavbar#LABEL_ID# href='#URL#'>#LABEL#</td></tr></table></td></tr>" S-Target TAG="BODY" --></TD></TR>
</table>


The code contains a small webbot that looks up the flagged listings and builds the links to those listings. In addition, I have added an extra <TD> element to get the same indent as the other content of the SPS area navigation panel.

Then you need to locate the slot in the SPS area navigation panel where you want the quick launch links to be added. A good location is below the 'Current location' and the 'Category navigation' SharePoint components. Locate this web control with FrontPage and add the copied code just below the CategoryNavigationWebPart component:

<SPSWC:CategoryNavigationWebPart runat="server" id="VerticalNavBar" DisplayStyle="VerticalOneLayer" />

<!-- ADD QUICK LAUNCH LINKS CODE HERE -->

<SPSWC:ToolBar runat="server" id="ActionBar" RenderIfEmpty="false" Orientation="Vertical" TitleLocId="CategoryManagement_ActionBar_Title_Text">

Save the SPS area after adding the code with FP2003, then do a hard refresh (ctrl-F5) of the page in MSIE to check that your changes are functioning as expected.

Note that you must change the location ID (1033) of the QLB code if your SharePoint installation is not using the US English version. Use e.g. 1044 on a Norwegian SharePoint version.

2 comments:

Chris said...

Does this work? I was able to get the headings to show, but not the lists or doc libs under these.

Kjell-Sverre Jerijærvi said...

It worked a year ago, but I have not tested it since. Unfortunately, I do not have a VPC with the combination of FP2003 and SPS handy, so I cannot check it now.

I recommend that you copy the complete QLB HTML code from an actual WSS team-site within your SPS server, do not use the code from my blog post ("edited for readability").