Home › Forums › Calendar Products › Events Calendar PRO › Reset Filters on Filterbar when doing a search
- This topic has 4 replies, 3 voices, and was last updated 10 years, 6 months ago by
Support Droid.
-
AuthorPosts
-
September 19, 2015 at 4:01 am #1006752
David
ParticipantHi there,
Is it possible to reset the active filter-settings in the filterbar, when doing a search for a term in the event bar?
For example if you hit the “search” button, all the category and price-filter settings are deactivated.
I am afraid that some visitors are doing a search with active filters and the search term won’t be found then?
So I was wondering if there would be a simple function or hook etc.?
Sincerely,
DavidSeptember 21, 2015 at 8:45 am #1007064Barry
MemberHi David,
This is by design and, unfortunately, I don’t see any terribly easy ways of implementing this cleanly.
It’s definitely possible we might consider making a change to facilitate this, however, so I’d love to hear a little more about how you envision this working.
If the visitor has checked various filters, would they remain checked when they perform a search (even if they are ignored) – or be wiped? Would you need to maintain an avenue for visitors to search filtered results, or would that not be a concern in your case?
Thanks!
September 28, 2015 at 8:05 am #1009180David
ParticipantHi Barry!
I think it would be great to have a visual notification or something which is informing the user about active Filters when searching for a term. I did a usability test and the user had to find a certain event. First he started to use the filter. After there were too many result, the user did a search by “term”. The event didn’t show up, because it was in a different category. As the filters were chosen by a dropdown menu, there is no visual confirmation that after doing a search by term, they are still activating. So my idea was wether resetting the filters when performing the search or notifying the user about the filters still being active.
I know that in the first place the categories should be more specific to prevent this scenario happening.
I hope I made my request a little bit more clear to you!
Cheers,
DavidSeptember 28, 2015 at 10:38 am #1009315Barry
MemberThanks, David – that definitely provides a little more insight.
So let’s say you want to provide a stronger indication to the user that one or more filters have been applied (following a search). You might use some logic like this to trigger that alert:
if ( is_search() && tribe_is_filtered_request() ) { /* ... */ }There is no such helper function as tribe_is_filtered_request(), however, so you’d need to build this yourself. Right at this time each filter exists as an anonymous object so trying to obtain information from those objects – such as if they are filtering the query or not – is tricky at best.
Even so, we can look at other variables which are accessible to us and make a pretty good informed guess about which if any filters have been applied.
Here are the different “filter slugs” used by default:
- eventcategory
- cost
- tags
- venues
- organizers
- dayofweek
- timeofday
When a visitor tries to apply these, a new query parameter is added to the URL, in the form tribe_SLUG=xxx. You can use this to try and detect if a filter has been added by looking at the keys of the $_REQUEST or $_GET variables.
Combining this with a little theming work would allow you to put together a suitable alert making it as clear as possible to the user that their search results are subject to a number of still-applied filters.
You could also effectively “disable” the filters by testing to see if they are set during a search, just like we covered, but instead of displaying an alert you could perform a redirect back to the same page (but with the relevant parameters removed from the URL query).
I appreciate this all sounds a little complicated and we’ll certainly consider some changes to make things more customizable going forward.
October 13, 2015 at 7:05 am #1014078Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Reset Filters on Filterbar when doing a search’ is closed to new replies.
