Aswath’s Blog

Idea away with wings..

Archive for April 16th, 2009

Make sure web part pages instance created with side navigation

Posted by aswatharamadaka on April 16, 2009

Problem:
When you create a new Web Part Page in SharePoint, it is created without left side navigation (or right side if you use rtl version).
The page’s layout and design are all inherited from the master page, and shown correctly, but the side navigation is not.

page1

Cause:
The left side navigation is defined in the Master Page, in the “PlaceHolderLeftNavBar” content place holder.
The templates for Web Part Pages shipped with SharePoint are overriding this content place holder and delete its content.

Solution:

Modify the page so it will not override the menu place holder, but inherite it from the Master Page. The place holders we are interested in are:
“PlaceHolderLeftNavBar” and “PlaceHolderNavSpacer”. The first one actually contains the menu control, and the last one reserves some width to maintain proportions.

Open SharePoint Designer.
Open the web part page you want to add the menu to.
In Code view – Look for the following lines and delete them:
<asp:Content ContentPlaceHolderId=”PlaceHolderLeftNavBar” runat=”server”></asp:Content>
and
<asp:Content ContentPlaceHolderId=”PlaceHolderNavSpacer” runat=”server”></asp:Content>
Save the file. SPD will warn you that you are about to customize the page. Confirm the warning.

page2

There are some other options to handle this without customizing the page, like adding another web part zone layout to the web part page creation page. These are not covered here.

Result:
Here is the result

page3

Posted in Sahrepoint Tips | Leave a Comment »