Skip Navigation

[Closed] Search Results from two Taxonomies

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 3 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#2215203
aa 2.png
aa 1.png

Hi there,

We have a couple of sites that are smaller versions of our much larger site. The focusing on just one area.

So the search bar at the top of this page:
hidden link

Is no longer working as we would like.

Is it possible to have two taxonomies in one search drop down...in the case Destination?

Currently the legacy View (see pic aa1) has taxonomy="area"

From our main site we had some custom code so we could 'choose' what was displayed here (see pic aa2)
This I have tried to add how I would like this:

$args['slug'] = array(

'lake-district',
'windermere-lake-district',
'coniston-lake-district',
'ullswater-lake-district',
'cartmel-cumbria',
);

The top one 'lake-district',
is the only AREA taxonomy.

The rest are a LOCATION taxonomy.

Is there a way of combining these two taxonomies so they are available in the list order I've shown? (see pic aa2)

I've tried random things however nothing works.

Worth an ask. Thank you.

#2215541

Hello,

I assume you are going to merge two taxonomy select dropdown options into one select dropdown.

If it is, there isn't such kind of built-in feature within Toolset plugins, and I don't think it is a good idea, if you use custom codes merged them, it might conducts other unexpected result, for example:
It will pass same URL parameter name to views, but Views don't know which taxonomy it is

#2215601
aa-2.png

Hi Luo,

Thank you for getting back to me. I didn't think this would be straight forward.

Thing is, as you can see in the attachment, these are our 'featured' locations. These only show a small selection of the properties we have....in total the are 67 on this site.

So am I to conclude, there is no way of add 'all' to the drop-down so it shows the option to select to view everything, or the small amount in the location taxonomies?

Many thanks, again. Pete

#2215637

You can add "All" option into the taxonomy filter, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-control-post-taxonomy
'default option text'
Add default option like All or Any on taxonomy select control.

And I see you have done it in your screenshot:
https://toolset.com/wp-content/uploads/2021/11/2215203-aa_1.png

To avoid more misunderstandings, please elaborate the question with more details:

there is no way of add 'all' to the drop-down so it shows the option to select to view everything, or the small amount in the location taxonomies?

If you want to limit the options of the taxonomy filter by user inputs, you can try to update search form with AJAX, for example:
Edit the post view you mentioned in screenshot:
https://toolset.com/wp-content/uploads/2021/11/2215203-aa_1.png
in section "Custom Search Settings", enable option "Let me choose individual settings manually"-> "Show only available options for each input"

#2215821

Hi there Luo,

Thank you for your reply.

Ok I don't understand how I would do, or add to my View this....

You can add "All" option into the taxonomy filter, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-control-post-taxonomy
'default option text'
Add default option like All or Any on taxonomy select control.

Then you say I have done this already.
We'll I have done nothing other than set the filter to the 'area' taxonomy, this in turn is showing all properties.

Hate to say, I also don't understand this....

in section "Custom Search Settings", enable option "Let me choose individual settings manually"-> "Show only available options for each input"

#2216367

Please provide your website credentials in below private message box, also point out the problem page URL and view URL, I can setup a demo for you.

The topic ‘[Closed] Search Results from two Taxonomies’ is closed to new replies.