This article will cover how you can add a web part on the SharePoint 2010 search page which will display the search term.
The search result page in SharePoint 2010 is intuitive and comes with great features like refinements, ranking or best bets and a lot more. This page can also be rebranded and the actual results that show in the Search Core Results Web Part can be modified by in many ways with XSL. On top of this you can add you own web parts in the web part zones.
Let us look how to improve the search user experience and display the word the user searched for, this could specially be useful if this is about a public faced web site and the search box may not be direct at top of the core results.
How to do this with help of a bit java script and a content editor:
- Create a .TXT file and insert the script below this instruction, give it the name SearchKeyword.txt and upload this to a folder in SharePoint, you can create a new folder in the root called Scripts if you wish.
- Edit the search result page and add the Web Part called Content Editor to the zone just above the Search Core Results Web Part.
- Edit the Web Part and type the link in the URL field to the .TXT file. Set Chrome Type to None.