Wednesday, February 16, 2011

Adding Top Link bar to SharePoint Basic Search Center Template

The Basic Search Center template in SP Foundation 2010 uses the minimal.master master page rather than the v4.master.  The search center template actually requires some additional content placeholders that the v4.master does not support.  I recently needed to add the Top link navigation to this template and decided to add the lines to the minimal.master to achieve this functionality.  Editing the master page allowed the change to persist to the results.aspx page as well which was the desired functionality.  To make the change, open the minimal.master page using SP Designer 2010 and find the following lines:

 <h3 class="s4-mini-header">
    <asp:ContentPlaceHolder id="PlaceHolderPageSubTitle" runat="server" />
   </h3>
  </div>
 </div>

The last line should be around line 118.  After the closing div tag add the following (Do not replace, just add):

<div id="s4-topheader2" class="s4-pr s4-notdlg">
     <a name="startNavigation"></a>
     <div class="s4-rp s4-app">
     </div>
     <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>
    </div>

16 comments:

Unknown said...

Nice one.. found this very useful! Thanks!

Leigh

Anonymous said...

Great post. It has been most helpful. Thanks!

RC said...

Thank you man. You give me a great help.
Can you tell me how can I use the same css that is used in v4.master?

Thank you very much.

Unknown said...

@RC: Not sure I understand. The CSS should be the same between both master pages. Does your top link bar look different on the minimal.master then the v3.master?

Hendu said...

Thank you so much for this post!! Do you know if you can make this "Global" meaning, across all site collections?

Anonymous said...

It works great. Thanks a lot!!

Jason

Rich said...

Deltascheme have developed this and offer it for free..

http://www.deltascheme.com/deltascheme-products/basic-search-center-with-navigation-for-sharepoint/

Anonymous said...

Thanks

very useful

Anonymous said...

Works like a champ, great detail on where to place in the minimal.master. Thank you!

Lee said...

Thanks, worked great!

Anonymous said...

Great detail on where to insert the code. Those of us who are not developers appreciate your attention to detail.Any idea how we get the bread crumbs to show up now?

Anonymous said...

This has just helped me you with Sharepoint Search Server Express.

Great to see that advice from over two years ago is still assisting those of us in need of a quick fix.

Anonymous said...

It works great. Thanks

h
Olav

Unknown said...

Doesn't work for me. After editing the file and checking it in did any of you do anything different?

Unknown said...

Go back and make sure you're updating the correct places. If you're still having problems, send me an e-mail with your HTML and I can take a look

Alan said...

UNKNOWN, you need to RIGHT CLICK MINIMAL.MASTER after modifying and hit "Set as Custom Master Page"