This is a blog post in the series "How to change how search results are displayed." To demonstrate how you can customize your search results, I'll use examples from an internal Microsoft Search Center.
For an overview of the blog posts in this series, go to How to change the way search results are displayed in SharePoint Server 2013.
In the previous blog post, I showed you how to add a custom action to the hover panel. This blog post will be short & sweet, so let’s get right to it.
How to change the text that is displayed in the Search Box Web Part
The screenshot below shows the default text that is displayed in the Search Box Web Part.
Here’s what you should do to change this text:
- In your mapped network drive, go to Display Templates --> Search, and open the file Control_SearchBox.
- Replace the value for the promt 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.
- Save the file.
In the Search Center, you can now see the new text.
So that’s it for this series. If you are planning to modify how search results are displayed in your Search Center, I hope you’ll find the information in this series helpful.
This whole guide has been great, utilizing the search with these handy tips will bring smiles on our users lips throughout the whole year 🙂
hi bella,
Can you guide about the paging in search results webpart?
I do not want the paging control to add #k and #s in the url.
Hi YurillA,
I’ve never come across this type of behavior. And I agree that is seems really strange…
I suggest that you contact Microsoft Support for further assistance.
Bella
Hi Kesari,
It’s difficult to say what your exact issue could be, but have you configured WAC? If not, see this article for more information: http://blogs.technet.com/b/speschka/archive/2012/07/23/configuring-office-web-apps-in-sharepoint-2013.aspx
Hope this helps.
Bella
Hi, Nice Work.
How can we display the {searchTerms} in our display Templates? Is their any managed property? I don't want to use javascript to fetch k's value from url. Please advice
Hi Gonzalo,
The features that I describe in this series are only available for private sites, such as Team sites, in SharePoint Online. For more information, see this blog post:
http://community.office365.com/en-us/b/office_365_community_blog/archive/2013/10/30/search-driven-publishing-features-are-now-available-in-sharepoint-online.aspx?ss=5298a40f-57ea-4100-9b58-111d117a3acc
Bella
Hi Abhishek,
I haven’t done this myself, but maybe the article Integrating location and map functionality in SharePoint 2013 could help (http://msdn.microsoft.com/en-us/library/office/jj163135%28v=office.15%29.aspx)
Bella
Hi KumarJee,
Have a look at this article:http://msdn.microsoft.com/en-us/library/ff394639.aspx
Bella
Happy to hear that 🙂
Hi Jasi,
I’m sorry, but I don’t know if this is possible.
Bella
Hi VarunVerma,
Have you tried using the query variable {SearchBoxQuery}?
Bella
Hi Alex,
Can you verify that you don’t have any syntax errors, and that you have modified the correct display template? If this is the case, and it still doesn’t work, then I suggest that you contact Microsoft Support.
Thanks,
Bella
Hi akshay,
The #k and #s are in the URL so that users can copy the URL of a specific search results page and send it to other users. The receivers will then will be able to enter the URL in their browser, and see the exact same search results page.
If you don't want the #k and #s in the URL, you'll have to implement custom paging controls.
Hope this helps,
Bella
Thank you so much..Really cool stuff..Please keep it coming
Hi Adil,
Thanks for the feedback 🙂 Glad you like it.
Bella
Great!
Cool.. could you please guide me i want to use my SearchApi (based on Lucien search ) in the share point search. so the result will be display from my searchApi and other function search result and refiner will work as it is.
Hi Bella, Really a nice article about display templates.keep up the good work..
Hi,
very Informative article. One observation When you hover on a result in your custom search results web part, I do not see a document Preview panel? I am also experiencing the same issue.
I created a custom Item Display Template based on default item template but not able to get the document preview over the hover panel.
Iam able to view the document preview with default item display template.
Can you assist with some valuable inputs.
Thank You.
Worked like a charm thanks!!
Hi Bella, This is great information, thank you! Do you know if this workaround can be used in SharePoint Online (Office 365)? I followed the steps above but had no luck. Any thoughts? Thanks, Gonzalo
Hello,
I came across a rather strange issue and I've been shooting in the dark to try fix it. I have a search box that sends the user to a results page where the results are shown in a search results web part. This works fine except when the search is done by an anonymous
user. In this case, when the anonymous user types in a search term and performs the search, the keyword they searched for seems to get cached or unchanged. For example, if I go to the site anonymously and search for "books", I see results for books and I see
the search box showing "books". A moment later if I search for "magazine", I still see results for "books" and I see the search box showing "books". Basically, the search box reverts to showing the first thing an anonymous user searches for no matter what
they type into it after the first search.
Any ideas on what could be causing this behavior with the search box?
Thanks!
This did not work for me. It still displays Search…
Hi Bella,
Can we change the default text shown in the Small Search box
Hi Bella, Nice series. Can you tell me if it is possible to display search results on Bing Maps.
Probably one of the best series I have ever come across in over 15 years. Thank you so much.