Add global navigation to SharePoint 2010 Minimal Master Page - Search

One of the most frequent requests I get from customers that have (fairly) vanilla SP2010 deployments is to have the global navigation links included on search pages. The simplest way to do this is to make a copy of minimal.master and copy a div tag from v4.master. Here are the steps:

1. Open SharePoint Designer and connect to the root of the site collection where your search center lives. You’re going to need to access to the master page gallery.

2. Select “Master Pages” from the “Site Objects” pane on the left.

3. Make a copy of “minimal.master” and name it something nice like “search.master”. Open this new master page in split view.

4. Find the div tag that encloses the “PlaceHolderTitleBreadcrumb” content place holder control and paste in this markup (which I just copied out of v4.master) right above it.  Be sure to check you exisiting v4.masterpage for the number of StaticDisplayLevels and MaximumDynamicDisplayLevels.  You will want to make sure that the markup you add matches those values.

<div class="s4-lp s4-toplinks">
    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
        <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
            <SharePoint:AspMenu
                ID="TopNavigationMenuV4"
                Runat="server"
                EnableViewState="false"
                DataSourceID="topSiteMap"
                AccessKey="<%$Resources:wss,navigation_accesskey%>"
                UseSimpleRendering="true"
                UseSeparateCss="false"
                Orientation="Horizontal"
                StaticDisplayLevels="2"
                MaximumDynamicDisplayLevels="1"

                SkipLinkText=""
                CssClass="s4-tn"/>
            <SharePoint:DelegateControl runat="server"
                ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
                <Template_Controls>
                    <asp:SiteMapDataSource
                        ShowStartingNode="False"
                        SiteMapProvider="SPNavigationProvider"
                        id="topSiteMap"
                        runat="server"
                        StartingNodeUrl="sid:1002"/>
                </Template_Controls>
            </SharePoint:DelegateControl>
        </asp:ContentPlaceHolder>
    </asp:ContentPlaceHolder>
</div>

5. Find the CSS registration tag for minimalv4.css and paste in this tag right above it.

<SharePoint:CssRegistration Name="corev4.css" runat="server"/>

6. Save, check in, and publish the new master page.

7. Browse to your search center and change the site master page to use the one you just published. Your global navigation should now show up directly below the dark blue band (assuming you have no custom branding) that has the site logo and title.  You can add in a <HR> below the control to add a horizontal line below the top level navigation.  This will make it look just like the v4.masterpage.

 

 


Categories: SharePoint 2010
Permalink | Comments (0) | Post RSSRSS comment feed