Tag Archive for: Display Template

SharePoint 2013 Search: Navigate to first Page

24 Feb 2014
February 24, 2014

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.

This example only works if you don not change the item count on the page – but who do that?

Result

The result looks like the following when you page beyond page 5.

image

Subtle change, but the End-Users may notice it.

Powershell: Enable Refiner Count for SharePoint 2013 Search Results

23 May 2013
May 23, 2013

The refiner count is a very useful indicator in the Search Center whether the click on the refinement is worth it or nor – and the implementation is so intuitive that even end-users understands it. But: It is disabled by default in SharePoint 2013. This post shows you how to enable the Refiner Count for SharePoint 2013 – manually and with PowerShell.

Refiner Count in SharePoint 2010

The refiner count was introduced in SharePoint 2010 and is a FAST for SharePoint feature. If you don’t have FAST installed and enabled the Refiner Count, the count is estimated roughly with the first 50 results because SharePoint Search was not capable of deep refinement.

Deep refinement is based on the aggregation of managed property statistics for all of the results of a search query. The indexer creates aggregation data that is used in the query matching process. The advantage of using this kind of query refinement is that the refinement options reflect all the items matching a query.

Query Refinement (FAST Search Server 2010 for SharePoint)

In other words, the refiner count could change after you click on a refiner which is very confusing for end-users.

If you have FAST for SharePoint installed the refiner count worked flawlessly but had to be enabled with a xml modification in the refiner webpart.

image

Refiner Count in SharePoint 2010 + FAST for SharePoint 2010

Refiner Count for SharePoint 2013

The refiner count is still possible with SharePoint 2013 – the concept is not new but the implementation has changed. And as already mentioned, the count is disabled by default:

Refiner Count for SharePoint 2013 not visible

Refiner count not visible (default)

As you might know, you can change the rendering/design of elements with Display Templates in SharePoint 2013, most importantly for search results – this also applies to refiners – which is great if you ask me. Basically all you have to do is change the Display Template for the Refiner Filter which is a html file and you are good to go.

The file is located in the site collections MasterPage gallery folder, /_catalogs/masterpage/Display Templates/Filters/Filter_Default.html and contains the definition for the refinement item.

If you open the file you can see in the very first lines of the file you can see those lines:

Change the lines (replace the false with the true in line 2) to:

And voila, the refiner count is visible:

Refiner Count for SharePoint 2013 visible

Refiner count for SharePoint 2013

PowerShell approach:

You have to do it more than once? Automate it!

Here is my short PowerShell script which automates the step above:

 

Usage:

Just download this script and call it with the –siteUrl parameter to enable the Refiner count for the specified Site Collection:

or add -hide to hide the refiner count again:

Enable the Refiner Count for SharePoint 2013 - automated with PowerShell

Enabling/Disabling the refiner count made easy!

Pretty easy, isn’t it?

SharePoint 2013 Design Manager: Map network drive on Windows Server 2012

07 Feb 2013
February 7, 2013

So the best way to adjust and edit MasterPages and DisplayTemplates in SharePoint 2013 is to map a network drive and edit the files directly there or copy them to this location.

If your SharePoint is hosted on Windows Server 2012 this does not work without configuration – I am really surprised that the config wizard or the PreRequisite Installer does not add the required service – but lets just focus on the solution.

Solution

Open the Server Manager.

image

Click next until “Features”.

image

Expand the greyed-out “User Interfaces and Infrastructure”, check the Desktop Experience entry (I took the screenshot after installing it).

image

Click next and install the feature. Then you have to reboot the Server.

After the reboot open the Service Manager (services.msc) and start the WebClient service – and if you want set it to automatic start so it works after the next reboot.

image

After this open an explorer and try to connect to \\<hostname>\_catalogs\ and the result should look like this:

image

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close