Forums Forums Search & Filter Pro Ajax search results do not update if search has not hits

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #119374

    I’m using an AJAX-enabled SF form as a global search, using search.php. Everything seems to be working great, but there is one issue:

    When you are already on a search results page, and do a new search which has no results, the page does not update and the old results and search query remain on the page. With AJAX off, or if the new search has results, things work as expected.

    Here’s a quick screencast to explain (the last search query shows how the page does not update): https://cl.ly/lSk7

    Trevor
    #119383

    This may be a function of the theme template file that you are using with the As an Archive display method.

    Anonymous
    #119385

    I have it set to use search.php which is just a default loop. I don’t understand how the theme could be affecting this. Could you expand on that?

    Trevor
    #119415
    This reply has been marked as private.
    Anonymous
    #119424
    This reply has been marked as private.
    Trevor
    #119466

    Ah, I see. This may be a little complicated to explain. There is a section of that template that does not get output if there are no results. So, as I can’t see what you have it set at, but IF you were to have the Ajax Results Container set at .article-list-container, as that is inside the section that does not get output, and so the Ajax would not work. Does that makes sense? I hope it does.

    So, in that template, see this line:

    <div class="medium-8 large-9 column">
    

    Maybe change this to:

    <div class="medium-8 large-9 column sf-ajax-container">
    

    and then change the Ajax Results Container to .sf-ajax-container

    Anonymous
    #120121

    Thanks for the help, sorting out my AJAX container “no results” block was definitely the culprit.

Viewing 7 posts - 1 through 7 (of 7 total)