Forums › Forums › Search & Filter Pro › filter for Event date?
Tagged: complex query, V3
- This topic has 9 replies, 2 voices, and was last updated 5 years, 2 months ago by Trevor.
-
Anonymous(Private) July 3, 2019 at 8:51 am #215498
Hi,
I’m setting up a filter for a list of Events. I want to have a radio button or drop-down with options: “All”, “Past”, or “Upcoming” to limit the results to Events in the past or future based on start date, which is a meta value. Is there a way to set up a filter parameter to perform this logic?If the above isn’t possible, would you consider this workaround: I tried including a link after the search form to “Show Past Events”. It adds a var to the querystring and reloads the page and I can manually skip future Events if I find this var. As soon as you adjust one of the other filters, however, the ajax call clobbers this querystring var and so it shows all Events again. Is there any way to preserve my querystring var within the ajax call performed by the filters?
Thanks and great plugin BTW 🙂
Chris
Trevor(Private) July 3, 2019 at 10:36 am #215513If it assists you, we do have Ajax hooks you might use. Some for when auto Count runs, and some for when Ajax fires on the results:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ // so load your scripts/function here again }); }(jQuery));</script>
If you have Auto Count enabled, this might refresh the form, and so the above code would change to use
sf:ajaxformfinish
-
AuthorPosts