Forums › Forums › Search & Filter Pro › Have external list of selected filters which can then be removed possible?
- This topic has 5 replies, 2 voices, and was last updated 3 years, 8 months ago by Trevor.
-
Anonymous(Private) July 5, 2019 at 9:28 am #215613
I have this design and I would like to know if it’s possible to create something like this.
As you can see the filter is on the left and when you select filters there will be a bar at the top of the search results showing you which filters you’ve have selected. These filters can then be removed or with the last item deleted all at once. Would something like this be possible with S&F?
Also is there a way to get the number amount of your selected filters. Eg with filter A and filter 1 there are in total 135 results (see design)
Hope to hear from you
Trevor(Private) July 5, 2019 at 2:23 pm #215627Some of what you ask for MIGHT be possible with a lot of custom coding (which would not be within the scope of our support), as you can access the filters array, but to add the ability to remove filters, and to show their counts, this is not possible.
It is something were are working on for V3.
Anonymous(Private) July 5, 2019 at 3:48 pm #215642Hey @Trevor thanks for your message. What would be the hooks that I need to look in to getting this off the ground?
Also there is no way to show how many results there are? Lets say I have 10 posts and I do not filter anything, there would be 10 results in total. But if I than search for post with the name “banana” there would only be 2 results, because there are only 2 posts related to banana. I would figure that this number would be fairly easy to get.
Trevor(Private) July 5, 2019 at 4:04 pm #215649To fetch the search terms, the https://searchandfilter.com/documentation/accessing-search-data/ guide is basic but you can extend the idea to grab lots of other data. If you have other filters, then it becomes a little more complex, but I can give you links. This thread might help you:
https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
… and this search will give similar threads I think:
https://support.searchandfilter.com/forums/search/sf_current_query+get_array
Note, if you are using Ajax refreshing of the results, any PHP needs to be inside the Ajax Container, or it will not update.
You could use this to display the filter array:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(1391)->current_query()->get_array(); echo '<pre>',print_r($sf_current_query,true),'</pre>'; ?>
Where the ID needs to match that of your form.
Trevor(Private) March 23, 2021 at 2:06 pm #275883We are testing the free core plugin now and finishing off the pro addon plugin. The other major component (which required a lot of coding) we finished a little while ago. It was to bring the capability to control the results layout, content and appearance, something we have left to themes and page builder plugins until now.
It was also intended to make it built in to the search plugin itself, but we instead decided to release it as a free standalone plugin:
https://wordpress.org/plugins/custom-layouts/
So, three plugins in all. One is released, one is in internal testing (soon to go to beta) and the third we are finishing off. Right now we are hoping within a few months.
-
AuthorPosts