FOLLOW US

Tuesday, February 14, 2012

No left navigation when new webpartpages are created in SharePoint 2010

Creating webpart pages or basic pages in SharePoint is done with a click of a button. But when you view the page you've created you won't get to see the left navigation menu. The cause I reckon is that the left side navigation is defined in the Master Page in the "PlaceHolderLeftNavBar" content place holder and templates for webpart pages shipped with SharePoint are overriding this content place holder and delete its content. 


The solution for this is to change 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". 


Start by opening the SharePoint Designer. Open the webpart page or basic 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> 
and
      <SharePoint:UIVersionedContent ID="WebPartPageHideQLStyles" UIVersion="4" runat="server">
      <ContentTemplate>
      <style type="text/css">
      body #s4-leftpanel {
      display:none;
      }
      .s4-ca {
      margin-left:0px;
      }
      </style>



Save the file. You will get a warning saying you are about to customize the page. Just go ahead.


Hope this saves time.

No comments:

Post a Comment