Forum Discussion
Refinement Web Part - Showing Refiner Counts in SharePoint Online
I'm encountering an issue with the MS documented process for displaying counts of refiners on refinement web parts.
As per the https://support.office.com/en-us/article/Change-settings-for-the-Refinement-Web-Part-fc0a2cb2-4947-4df8-ace2-3486ad8318b3, 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:
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!
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.
2 Replies
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.
- Stephen HayesCopper ContributorThanks Pieter - excellent, clear response in your blog!