SOLVED

Refinement Web Part - Showing Refiner Counts in SharePoint Online

Copper Contributor

I'm encountering an issue with the MS documented process for displaying counts of refiners on refinement web parts.

 

As per the recommended steps, I've altered the ShowCounts variable in the Filter_Default.html display template from 'false' to 'true'. However this is causing the web part to throw an error in an apparently unrelated section of the display template:

 

Capture.JPG

 

 

This line appears to be instantiating a date, and does not seem related to the count variable - 'var g_requireJSDone = new Date().getTime();'

 

I'm encountering this issue across multiple different tenants and site collections - including recently created, out-of-the box ones.

 

Has anyone else encountered this issue? Anyone know of a workaround?

 

Thanks!

2 Replies
best response confirmed by Stephen Hayes (Copper Contributor)
Solution

Hi @Stephen Hayes,

 

First of all that article isn't great. Editing out of the box display tmeplates is somehting that shouldn't be done. it is better to create a copy of that display template and give it a new name.

 

More details here:

 

https://veenstra.me.uk/2016/09/13/creating-counters-in-your-refinement-panels/

 

Then on the issue. There seems to be a problem with the script section of the display template. moving those lines  up a bit will resolve the problem.

 

Thanks Pieter - excellent, clear response in your blog!
1 best response

Accepted Solutions
best response confirmed by Stephen Hayes (Copper Contributor)
Solution

Hi @Stephen Hayes,

 

First of all that article isn't great. Editing out of the box display tmeplates is somehting that shouldn't be done. it is better to create a copy of that display template and give it a new name.

 

More details here:

 

https://veenstra.me.uk/2016/09/13/creating-counters-in-your-refinement-panels/

 

Then on the issue. There seems to be a problem with the script section of the display template. moving those lines  up a bit will resolve the problem.

 

View solution in original post