Wednesday, June 24, 2009

Display Left Navigation on Web Part Page Stored in a Document Library

The users in one group in my company decided to use web part pages to host multiple document libraries and lists in one page. To be honest, I don’t like this as once the users know how to create pages, they will create more and more pages, and in each pages they will create more and more libraries and lists, finally both the users and I will be crazy to manage the huge number of libraries and lists. (Unfortunately this has happened. When I clicked View All Contents, I got a huge list of libraries and lists). Anyway, user is GOD, so I did for them.

Now it comes a problem. When a user click the page, the left navigation gone! Users need it back.

After some investigations, I noticed that these pages have an empty placeholder that actually overrides what is there in the master page.

<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>

Open these pages in the SharePoint Designer. If you remove above lines, you'll have the left navigation again visible on the page.

If you don’t want to modify page by page, there’re two ways to achieve the goal: first one, modify the master page. Second one, remove the above three lines from the template files (8 templates) which locate in \12\TEMPLATE\1036\STS\DOCTEMP\SMARTPGS\spstdX.aspx (X is from 1 to 8)

But I don't recommand you to use these two ways as the first one affects all pages in the site collections, and the second affects all pages created after the changing in the FARM.

No comments:

Post a Comment