New web part pages created without side navigation

18 בספטמבר 2007

תגיות: ,
תגובה אחת

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.



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.



  1. Open SharePoint Designer.
  2. Open the web part page you want to add the menu to.
  3. 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>
  4. Save the file. SPD will warn you that you are about to customize the page. Confirm the warning.

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 (Click to enlarge):


 

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

תגובה אחת

  1. ליאור צורף25 בספטמבר 2007 ב 14:25

    Hi Itay,

    Did you get the invitation to bloggers event @ Microsoft on October 8th?
    If not, please contact me at http://blogs.microsoft.co.il/blogs/liorz/contact.aspx

    We'd love to see you there!

    Lior

    הגב