SharePoint 2020

The Vision for a Future of Clarity

Replace Default Search Box using Sharepoint Designer 2010

These instructions will show you how to replace the default search box that comes with the default V4 Master-page.

This is useful if you are an Admin for a sub-site and don’t have permission or authority to edit the Site Collection search settings.

* Before you begin, backup your Master-page before making changes.

1: Within SharePoint Designer 2010, open up the Master-Page of your site and search for this line:

<SharePoint:DelegateControl runat=”server” ControlId=”SmallSearchInputBox” Version=”4″/>

2: Select the full line and delete it, click save.  On the Insert Menu, you will then notice the Web Part button become active. (You must save the master-page or the button will remain inactive)

3: From the Web-part drop-down menu, select Search Box.

4: Once the web-part is inserted, you can then edit the code as you require.

i.e: Adding in <SearchResultPageURL xmlns=”urn:schemas-microsoft-com:SearchBoxEx”>/sharepoint2010/finance/search/pages/results.aspx</SearchResultPageURL> into the web-part code that’s been inserted with direct the user to a specific Results Page.

5: You do get options in the Tag Properties window-pane but any changes I made altered the web-part code and caused the site to error on reload.

Sample code as shown.  You can copy the code but the WebPartId will need to be changed.

<div id="s4-searcharea" class="s4-search s4-rp">
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SPSWC:SearchBoxEx webpart="true" runat="server" __WebPartId="{EDDE30A6-FEF6-4CFD-AF37-FD556E4ED1AA}">
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">

<Title>Search Box</Title>
<Description>Displays a search box that allows users to search for information.</Description>
<FrameType>None</FrameType>
<AllowMinimize>true</AllowMinimize>
<AllowRemove>true</AllowRemove>
<IsVisible>true</IsVisible>
<Width>400px</Width>
<GoImageUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch15.png</GoImageUrl>
<GoImageUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchrtl15.png</GoImageUrlRTL>
<GoImageActiveUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchhover15.png</GoImageActiveUrl>
<GoImageActiveUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchrtlhover15.png</GoImageActiveUrlRTL>
<SearchResultPageURL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/sharepoint2010/finance/search/pages/results.aspx</SearchResultPageURL>
<DropDownModeEx xmlns="urn:schemas-microsoft-com:SearchBoxEx">HideScopeDD_DefaultContextual</DropDownModeEx>
<ID>g_edde30a6_fef6_4cfd_af37_fd556e4ed1aa</ID></WebPart></SPSWC:SearchBoxEx>
</asp:ContentPlaceHolder>
</div>

Any questions just ask, thanks for reading.

Advertisements

May 25, 2012 - Posted by | SharePoint 2010, SharePoint Designer 2010 | , ,

2 Comments »

  1. Hi Scott, thanks for reading.
    Take a look at my other post: https://sharepoint2020.wordpress.com/2012/05/06/google-search-appliance-web-part-for-sharepoint-results-page/
    You might find a solution there.

    Comment by Brett | May 22, 2013 | Reply

  2. Hey, just about a year on and I’ve got a Q 🙂
    Can this be configured to search the web (not SP site) and even better can it use Google?

    Comment by Scott | May 21, 2013 | Reply


Post a Comment

Please log in using one of these methods to post your comment:

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: