0

We are currently building out a publishing site with SP 2010. ON the Master, we are hiding the control. I want to now expose this on a particular page layout. If at all possible I want to avoid using a second master page. What is the easiest way to unhide so the page can consume the control.

Assistance always appreciated from the community.

2 Answers 2

3

If I understood your question correctly you are looking for a way to hide left navigation (Quik launch) on most of site pages and show it just on pages of certain page layout. Important thing here is: What is commonly used scenario (or default scenario): navigation is visible or navigation is hidden? (I am assuming navigation is hidden)

The simplest approach I could think of is to override some styles in masterpage to hide left navigation, wrap those styles in some custom ContentPlaceHolder and then override it on targeted page layout. In my opinion by doing so you are making smallest possible change to achieve your goal.

In masterpage add new custom ContentPlaceHolder (I think that the best place is just before PlaceHolderAdditionalPageHead):

<asp:ContentPlaceHolder id="PlaceHolderHideLeft" runat="server">
    <style type="text/css">
        #s4-leftpanel {  
          display:none; 
        }
        .s4-ca {  
              margin-left: 5px;  
              background: transparent; 
        }
    </style>
</asp:ContentPlaceHolder>

Now you have navigation hidden on all pages that are inheriting masterpage.

Next step is to override ContentPlaceHolder in targeted page layout with .... nothing. So add following markup to your page layout:

 <asp:Content ContentPlaceholderID="PlaceHolderHideLeft" runat="server" />

This page layout will no longer use custom style overrides and will display left navigation.

0

I could be wrong, but pretty certain you just need to pick a different page layout. There's a ton out of the box but with the OOTB page layout the left nav is hidden.

2
  • I would like to add the Left Na not have it hidden Commented Jan 21, 2011 at 17:26
  • Typically with a publishing site based on the nightandday.master, you just need to pick a different page layout. The default one has it hidden but you apply a different one (in the ribbon) and the navigation will show. Only one master page, yet the page layouts make the difference in whether the nav shows. Does that help? A page layout Commented Jan 21, 2011 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.