I'm having problems with Content Search Web Part, custom controls (which filters results based on year) and paging.

Query string in CSWP looks like

path:"http://MySite/Something"  (IsDocument:"True" OR contentclass:"STS_ListItem")  (ContentType:"Article Page")PublishingStartDateOWSDATE:{QueryString.year}

Testing this query returs desired items. Custom control is dropdown menu which triggers following JavaScript code

$("#year-selector").change(function() {
    window.location.href = "/" + $("html").attr("lang") + "/Something/news-year.aspx?year=" + $(this).val();

CSWP works fine when I leave my custom control alone. However, as soon as I'm trying to filter items based on year (via custom control), CSWP shows first 5 items ok (as it should), however, when I hit "Show More Results" (paging), it just fails to show anything (blank white page). What am I doing wrong?

1 Answer 1

$("#year-selector").change(function() {
    window.location.href = "/" + $("html").attr("lang") + "/Something/news-year.aspx?year=" + $(this).val() + "&";

I just added "&" sign at the end of the custom control's URL and seems like everything is working just fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.