×
Search results provided by Azure Search - read how I built it in this post.
Max Melcher

2 minute read

Sometimes clients come up with crazy requests “I can not go back to first page, this pagination is not good enough” – but this one was reasonable and SharePoint 2013 search is so easy customizable, lets take it as an exercise!

Everything is a Display Template

As the caption says, you can change almost every design aspect in SharePoint 2013 Search by changing a html file (or a .js file if you are on Foundation) – this includes the general rendering of the search results and with it the pagination.

image

So let’s try to change it to the desired behavior - of course I know that you can remove the #s or click on the search loop again.

Control_SearchResults.html

I change a system file here – do that only if you know what you are doing and document your changes!

Open the file (MasterPage gallery > Display Templates > Search) and go to line 248. Then paste the following in – or download the whole template: Control_SearchResults.

if (pagingInfo.length == 8 && pagingInfo[0].startItem > 31)
    {
_#-->