SharePoint 2010 Best Bets Configuration

Visit this page for setting up best bets in OOTB search:

The surfray site also provided an article about this:

One thing either of the sites mentioned was to add a best bet web part to the result page to display the best bets.


Hide navigation nodes from showing in search result

When searching a term in SharePoint 2010, the result returns pages that doesn’t contain the term but it’s nested sub pages has the term. For example, the “Science” page which doesn’t contain the word “carbon” but it has a sub site called “Carbon” which contains the word “carbon”. When searching “carbon”, both the “Science” page and “Carbon” page gets displayed in the result set. To hide the top level pages which doesn’t contain the searched term from the result set, the following code needs to be added to both the global navigation and quick launch divs.

class = "noindex"


Create Custom Master Page on SharePoint Search Site

I’ve been working on customizing the CCRB search site to match the look of the home page. As the home page uses Synesthesia template so initially tried to use the search master page associated with it. However, after applying it, the content area stretched to have a full width rather than fixed and centered. Thus, decided to  started from scratch and include the classes that used in the template.


  1. Standard SharePoint 2010
  2. Uses Synesthesia template 

Final look:

  • Follow Randy’s article to create a basic master page with navigation for the search site. (Note: it uses v4.master not minimal.master)
  • Add
<script type="text/javascript"> 
     function ProcessImn(){} 
     function ProcessImnMarkers(){}    

after <SharePoint:SPHelpPageComponent>, before the style tag

  • Apended the following code inside the style tag in the header section.
/* ------------------------------------------ */ 
/* -- My Custom CSS -- */ 
/* ------------------------------------------ */ 
 background:url('../../../Style Library/CCRB/images/mainBG.jpg') top center no-repeat #fff;
 font-family:Arial, Helvetica, sans-serif;
 width: 960px !important;
/* Top Menu */
.NavMainBar {
 border:0px solid #000;
.NavBarIn {
.NavBarLeft {
 background-image:url('../../../Style Library/CCRB/images/navBarLeft.png'); 
.NavBarRight {
 background-image:url('../../../Style Library/CCRB/images/navBarRight.png'); 
.NavBarFill {
 background-image:url('../../../Style Library/CCRB/images/navBarFill.png'); 
.s4-tn{padding:0; margin:0; background-color:transparent; color:#444;}
.s4-pr s4-notdlg {background-color:#e6f5c5;}
.s4-tn li.static > .menu-item{color:#444; padding:6px 20px 0 20px; margin:0; font-size:14px; font-weight:bold; height:20px;background-image:url('../../../Style Library/CCRB/images/navBarSep.png'); background-repeat:no-repeat; background-position:right 0px;}
.s4-tn li.static > a:hover{color:#0072bc; text-decoration:none;}
.s4-toplinks .s4-tn a.selected{border:0px solid #444; background-color:#2e84b6; color:#fff; padding:5px 10px; margin:0 2px 0 0;}
.s4-toplinks .s4-tn a.selected:hover{color:#333;}
/* Sub items border */
.s4-tn ul.dynamic{background-color:transparent; z-index:20;}
/* Menu Item */
.s4-tn li.dynamic > .menu-item{display:block; padding:4px 10px; background-color:#fff; color:#333; border-bottom:1px solid #ccc;}
.s4-tn li.dynamic > a, .s4-tn li.dynamic > a:visited {color:#333;}
/* Menu Item Hover Over */
.s4-tn li.dynamic > a:hover{color:#0072bc; text-decoration:none; background-color:#b5d1e1; font-weight:bold;}
 margin:0 auto; 
.shadowLeft {
 background: url("../../../Style Library/CCRB/images/shadow-left.png"); 
 background-repeat: repeat-y;
 background-position: left; 
 padding: 0 0 0 28px;
.shadowRight {
 background: url("../../../Style Library/CCRB/images/shadow-right.png");
 background-repeat: repeat-y;
 background-position: right top;
 padding: 0 28px 0 0;
.shadowBottom {
 background: url("../../../Style Library/CCRB/images/shadow-bottom.png");
 background-repeat: no-repeat;
 height: 36px;
.bodyContainer {
/* Bottom Footer */
.bFooter{background:#d1e4ef; font-size:10px; color:#666; clear:both; width:100%; height:30px;}
.bFooter p{margin:0; padding:5px 10px;}
.bFooter a{display:inline; padding:0; color:#666;}
/*-----------------End My Custom CSS---------------------------------*/
  • Remove

from body tag.

  • Add
<div class="container">
  <div class="shadowLeft"><!-- Start Shadow Left -->
    <div class="shadowRight"><!-- Start Shadow Right -->

after the body tag before the form tag.

  • Wrap around the s4-ribbonrow div tag with the following code around
<SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">

after the ControlId=”GlobalNavigation” tag to control whether display the ribbon for anonymous users.

  • After the s4-searcharea div, remove
 <div class="s4-rp s4-app"></div>


<div class="s4-lp s4-toplinks">
  • Add
<div class="NavMainBar">
  <div class="NavBarLeft"></div>
  <div class="NavBarFill">
    <div class="NavBarIn">

before the PlaceHolderTopNavBar tag and add close tag around it

  • Remove the h2 tag and it’s content after
  • After the close tag of the NavBarFill, add
 <div class="NavBarRight"></div>
  • Scroll to the very bottom of the page, Before the close body tag and after the WarnOnUnsupportedBrowsers, add
 <div class="bFooter"><p>Copyright</p></div>
</div><!--close shadowRight div-->
</div><!--close shadowLeft div-->
<div class="shadowBottom"></div>
</div><!--close container div-->

Search Site Custom Master Page and Default Master Pagge

Wasted my SharePoint Administrator half a day to debug something that was my fault. Sorry Dave!

The search site(Standard SharePoint) uses minimal.master as the Site master page(In SPD, choose Set As Custom Master Page) and uses v4.master as the System master page(In SPD, choose Set As Default Master Page)

To customize the master page on search site, make copy of minimal.master and DON’T change v4.master as the DEFAULT MASTER PAGE!!


Add home and back button to the search result page in SharePoint 2010

Once people get into the search result page, there is no way to go back to the previous page without clicking the browser back button.

We can add some code to a content editor web part to display a button on the page to let people go back to previous page and with search term displaying in the search box.

Here is the code to add to a content editor web part:

<!–Home button–>

<a href=”/”>
 <img src=”_layouts/images/hhome.png” border=”0″ alt=””/>
<a href=”/”>Home</a>

<!–Back button–>
<a onclick=”history.go(-1)” href=”#”>
 <img src=”_layouts/images/back.gif” border=”0″ alt=””/>
<a onclick=”history.go(-1)” href=”#”>Back</a>