- Make a copy of v4.master (or whatever other custom master page you are working with) and give it a new name like v4_searchcenter.master.
- Edit the new master page and locate and remove the PlaceHolderTitleBreadcrumb. This will allow the pop-out breadcrumb to still function properly:
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
<SharePoint:ListSiteMapPath
runat="server"
SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"
RenderCurrentNodeAsLink="false"
PathSeparator=""
CssClass="s4-breadcrumb"
NodeStyle-CssClass="s4-breadcrumbNode"
CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
RootNodeStyle-CssClass="s4-breadcrumbRootNode"
NodeImageOffsetX=0
NodeImageOffsetY=353
NodeImageWidth=16
NodeImageHeight=16
NodeImageUrl="/_layouts/images/fgimg.png"
RTLNodeImageOffsetX=0
RTLNodeImageOffsetY=376
RTLNodeImageWidth=16
RTLNodeImageHeight=16
RTLNodeImageUrl="/_layouts/images/fgimg.png"
HideInteriorRootNodes="true"
SkipLinkText="" />
</asp:ContentPlaceHolder> - Next, add the PlaceHolderTitleBreadcrumb back right before the PlaceHolderMain. This will allow the search center to inject the search box in a good location:
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"></asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server"/> - Move PlaceHolderPageTitleInTitleArea (and any supporting HTML) to a hidden panel because this placeholder isn’t used the same way in the search center:
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
<asp:Panel visible="false" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
</asp:Panel> - For v4.master you will also want to remove ClusteredDirectionalSeparatorArrow and <h2></h2>. It won’t make sense to show these at the top now:
<SharePoint:ClusteredDirectionalSeparatorArrow runat="server"/>
<h2></h2> - Next, several lines of CSS need to be added to make sure things look right for the search center. You can add them to the <head> section of the master page:
<style type="text/css">
5. Save the new master page, and check in / publish as a major version and approve it. Apply this master page to only the search center, and apply it as site master page while leaving system master page set as v4.master.
/* 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;
}
</style>
- Add <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server"/> to the hidden panel.
- Remove <div id="s4-ribboncont">…</div> and ALL of its contents.
- Add in its place this line: <asp:ContentPlaceHolder ID="SPNavigation" runat="server"></asp:ContentPlaceHolder>.
screenshots of the final result:
No comments:
Post a Comment