Skip Navigation

[Resolved] Dropdown filters not working together

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by Minesh 1 month ago.

Assisted by: Minesh.

Author
Posts
#2789605

My site gathers texts in philosophy. They are categorised using multiple custom taxonomies and fields. I'm want users to be able to filter search and archive results by those taxonomies and fields.

I built a test Search page for it, using all the filters: hidden link (need to click on 'Filters' to see the filters)

The problem is that the dropdown filters - Topics, Traditions and Languages - seem to not work together. If I select a Topic, the search results are filtered by that topic. But when I select both a Topic and a Tradition, the Topic is ignored and things are only filtered by Tradition. Likewise, if a Language filter is selected, Topics and Traditions are ignored. Interestingly, they all do work with the remaining filters (Year, Medium, Difficulty and Use).

Can you help me work out why the Topics, Traditions and Languages don't work together?

PS. The way this should work, is: there should be an AND function between all the separate filters, and an OR function within them, so that if a user selects three Topics, a Tradition and two Difficulties, the results will show entries which are classified under any of those three topics, and the tradition, and either of the two difficulties.

#2789636

Apologies, these are multiselect filters, not dropdowns.

#2789699

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support. The Multi-select fields are connected with OR and not AND in Toolset.

If you want to have them as AND you need to create a custom code.

You can check the steps below to see how to implement such a feature:

https://toolset.com/forums/topic/set-custom-search-to-and-instead-of-or/#post-2155235

Please note: The reply time will be longer than normal due to holidays.

Thanks.

#2789753

Hi Christopher,
Thanks for looking into this. I followed the link but the supporter there says that his solution didn't work. Then there is a mention that something worked but it's not clear what - perhaps it was discussed in private messages? I'd be most obliged if you could let me know how I can apply this to my specific case.
Best,
Simon

#2789820

Christopher Amirian
Supporter

Languages: English (English )

Hi Simon,

I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.

Make sure you set the next reply as private.

I will need to check your scenario and if I fail to find a solution I will need to ask the second tier support.

Just FYI, it might take time as we are not at full capacity during the holiday season.

Thank you for your understanding.

#2790004

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I've communicated all details with the previous ticket you reported.
- https://toolset.com/forums/topic/multiple-filters-to-use-an-and-rather-than-or-function/page/2/

And also shated details why its not working and the actual cause is the filter you added using custom code.

If you try to remove the Time/Time Period including the both inputboxes you will notice that it the filters you are taling about like Topics etc..etc.. should start working.

I also demonstrated it by adding new view and all those filters with the previous ticket I shared above.

#2790283

Hi. I'm trying to address the time filter problem separately. You'll notice that the view I'm using now doesn't have any custom code on it and yet it still fails in the way described above. I tried to make it work as it does on the view you created but can't - something is breaking it and I don't know what. As there's no third party code here, can you please help me with this?

#2790335

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I checked your view:
- hidden link

I'm not sure if you are displaying correct content template attached to your view.

IF you naviagate to section "Templates for this View" it shows two content template attached to your view but when you check the "Loop Editor" section it shows it suppose to display content template "loop-item-in-search-view" - can you please correct those content temmplates and remove unwanted content template and try to display correct content template within your view's loop.

#2790755

The "loop-item-in-search-view" is the template which displays the actual entries.

The other content template is just a note that appears at the end to encourage users to add more entries. It's just static content, it's not actually querying the database at all. I only created it as a content template because I use it in a few different views and archives, simply so I can just make changes in one place in case there are changes to be made.

I'm using both those content templates on the old search page which is currently live and they seem to work fine there ( /search ). Do you think they could impact the filters?

#2790980

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

In order to eliminate all those doubts - I suggest you setup a brand new view and add all those required fitlers one by one and within view's loop output only addd few items and check if that works. If you see all filters and loop output is showing the correct output then later add your desired content template to your loop ouput. Does that makes sence?

I already demonstrated you that with brand new view all filters used to work. Can you give a try and check.