Forums › Forums › Search & Filter Pro › Ajax search results do not update if search has not hits
- This topic has 6 replies, 2 voices, and was last updated 7 years, 5 months ago by Anonymous.
-
Anonymous(Private) July 7, 2017 at 8:07 pm #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(Private) July 9, 2017 at 8:51 am #119466Ah, 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
-
AuthorPosts