Customization of SharePoint Search Box Web Part in 2013

In this article, we will see how to customize the Search Box web part where your SharePoint search is done. The Search Box Web Part is used in the home page in the search center and in all the search results pages, like people results, results, and video results pages.

Step 1

Create a new site collection “My Search” and choose the Site template as Enterprise Search Center.



Step 2

By default, the site result page looks like this. Suppose you want to add watermark text as “SearchHere” in the Search Box highlighted below.



Step 3

Go to the Site Settings and select the Master Page and Page Layouts sections.



Step 4

Select the Display Templates and look for the file name “Control_Searchbox.html”.



Step 5

Replace the value for the prompt variable with the text that you want to display. Enclose the text in quotation marks. The following screenshot shows how I changed this in my Search Center scenario.



Step 6

Upload “Control_Searchbox.html “back to the Master Page Gallery.

Step 7

The changes are reflected in the Search Box web part as highlighted below.


 

Up Next
    Ebook Download
    View all
    Learn
    View all