Skip to content

Convert a Custom Master Page to A Search Master Page in SharePoint 2010

by on December 15, 2011
  1. Create a copy of your master and rename it from MyCustom.Master to MyCustomSearch.Master
  2. Remove the PlaceHolderTitleBreadcrumb control: <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"> and the closing tag </asp:ContentPlaceHolder> NOTE: Remove only the control tag not the contents! Do not forget the closing tag!!!
  3. Move the PlaceHolderTitleBreadcrumb control before PlaceHolderMain: <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"></asp:ContentPlaceHolder>
  4. Move PlaceHolderPageTitleInTitleArea to hidden panel: <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" /> NOTE: commenting out SharePoint controls can cause script and functionality errors!
  5. Style the search page as needed, here are some starter styles which can be placed directly in the master page. Be sure to change the link styles to match your design!

NOTE: This style information was gathered from Randy Drisgill’s blog post on converting custom master pages to search master pages, as well as personal experience. I have added a couple of changes to take care of issues I have run across in my travels. ^_^

<style type="text/css">
/* remove left margin */
.s4-ca {
margin-left: 0px;
}
/* remove gray background at top (optional) */
.srch-sb-results {
background:transparent none repeat scroll 0 0;
}
/* clean up top padding on 1st search page */
.srch-sb-main {
padding-top: 20px;
}
/* remove centering on 1st search page (optional) */
.srch-sb-results4 {
margin: inherit;
padding-left: 20px;
}
/* remove background color on 1st search page (useful for colored designs) */
.ms-bodyareaframe {
background-color: transparent;
}
/* —————————————— */
/* — CSS that may be req. to reset the search styling — */
/* —————————————— */
/* fix height of area above search results */
td.ms-titleareaframe, div.ms-titleareaframe, .ms-pagetitleareaframe {
height: auto !important;
}
/* fix border color on search results */
.ms-main .ms-ptabrx, .ms-main .ms-sctabrx, .ms-main .ms-ptabcn, .ms-main .ms-sctabcn {
border-color: #eeeeee;
}
/* fix arrangement of body area on search results */
.srch-sb-results {
height: auto;
}
/* fix positioning of prefs and advanced link on results */
.ms-sblink {
display:block;
}
/* fix the color of the prefs and advanced link on results */
.ms-sblink a:link, .ms-sblink a:visited, .ms-sblink a:hover {
color:#0072BC;
}

/*added by emerson bruce – fix to spacer and margin*/

body #s4-leftpanel{
    width:auto;
}
.ms-pagemargin{
    background:#ffffff;
}
</style>

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: