Forums › Forums › Search & Filter Pro › Results shown although no filter set, yet
- This topic has 5 replies, 2 voices, and was last updated 9 years, 4 months ago by Ross.
-
Anonymous(Private) July 7, 2015 at 2:39 pm #20911
Hi (again)
I freshly installed the PRO and intuitively created a form.
So far, looks very promising. I noticed issues when executing AJAX searching using shortcodes for filter and results: (one topic per issue in the forum)
When loading a search page using shortcodes, all results are displayed even though the user has not set any filters, yet. I would like to start with 0 results when nothing is setWhat am I doing wrong?
Thanks
Carsten
Ross Moderator(Private) July 9, 2015 at 12:33 pm #21114Hey again 🙂
You’re not doing anything wrong, I’m thinking of actually adding this in as an option in the admin, but its really not too difficult to implement.
What you would need to do is hide the div initially with CSS – which would be either
.search-filter-results
or#search-filter-results-1234
Then you would need to display the results after the search has been initiated – you can do this with JS by attaching an event listener to detect when a search has completed:
http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/
$(".searchandfilter").on("sf:ajaxfinish",function(){ console.log("ajax search complete"); //so load your lightbox or JS scripts here again });
Thanks
Ross Moderator(Private) July 9, 2015 at 1:35 pm #21130True, in that case you will have to wait for the option where no query is even performed until user interaction.
In some scenarios it would be an advantage to have extra searchable content, rather than empty space.
Anonymous(Private) July 10, 2015 at 8:12 am #21177I agree, both approaches are useful and in fact we need both:
A) Global search form –>Show nothing initially
B) News Corner –> Shown all news, let visitor drill down by category
So, a switch per FORM would be most appropriate and I would believe it would not be so hard for the developers to add this extra option that is handled in a small IF in the rendering…..Ross Moderator(Private) July 10, 2015 at 12:36 pm #21198You’re right its not hard at all 😉 Will be looking to add this in!
-
AuthorPosts