Now, I've already given the game away here in the title of this article: some of the search refiners functionality stopped working. Which bit? Well, nothing overly important - simply the "show more" option that appears in the refiners when more than a specified number of refiners are present. More to the point is why it happens?
Having examined pages with and without the Search Box, it appears the Search Box Web Part is responsible for adding a JavaScript function and a reference to the search.js file. The function is effectively a check for the search.js, but without it the "show more" option will fail as it calls this function first and as it can't find it, it doesn't work.
The following was an extract I added to my Search Results Xslt to get the page to function correctly:
function SearchEnsureSOD() {
EnsureScript('search.js', typeof(RenderTaggingControl));
}
_spBodyOnLoadFunctionNames.push('SearchEnsureSOD');
EnsureScript('search.js', typeof(RenderTaggingControl));
}
_spBodyOnLoadFunctionNames.push('SearchEnsureSOD');
The "typeof" used by
the EnsureScript function call is usually against GoSearch but this is present
only when the Search Box Web Part is present. I've used RenderTaggingControl
instead as this is present when the refiners are present.
No comments:
Post a Comment