Add home and back button to the search result page in SharePoint

So, this was originally written for SharePoint 2007 and the icons are designed for SharePoint 2013, but the methodology still works and you certainly could choose to use this on SharePoint 2010 or SharePoint 2013. I don’t know if it still applies to SharePoint 2016 search centers. The problem is once people get into the search result page, there is no way to go back to the previous page without clicking the browser back button.

One thing we can do is we can add some code to a content editor web part to display a button on the page to let people go back to previous page and with search term displaying in the search box.


Here is the code to add to a content editor web part:

<!–Home button–>

<a href=”/”>
     <img src=”_layouts/images/hhome.png” border=”0″ alt=””/>
< /a>
< a href=”/”>Home</a>

<!–Back button–>
< a onclick=”history.go(-1)” href=”#”>
 <img src=”_layouts/images/back.gif” border=”0″ alt=””/>
< /a>
< a onclick=”history.go(-1)” href=”#”>Back</a>

About Ben Adams

Ben Adams is a seasoned SharePoint Infrastructure Architect and proven leader. As a former Microsoft Certified Trainer and MCITP, Ben enjoys socializing SharePoint in the community and helping others come up with successful deployment models for SharePoint. Ben also enjoys music and photography.
Posted on by Ben Adams

Leave a Reply

Your email address will not be published. Required fields are marked *