Skip Navigation

[Resolved] Only show selected search options in search bar

This support ticket is created 2 years, 8 months 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/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by michelL 2 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#2352051
options are changed.png
select groningen.png

Hi there,

I want to create a search bar like attached files.
Can you tell me;
1\ When I select an option all the order options will change if they contain this selected value
2\ How can I add the show more/show less to the search bar?
3\ What is better to use in this case a toolset view or an Archive?

Hope you can help me.

Michel.

#2352315

Hi Michel,

Thank you for contacting us and I'd be happy to assist.

1\ When I select an option all the order options will change if they contain this selected value
- In the view's "View Search" block settings, there is an option "Show only filter options that would produce results" which is turned on by default.
( example screenshot: hidden link )

This option ensures that whenever any search field option is changed, all the search form field options are updated so that only the options which can produce some results are available.

2\ How can I add the show more/show less to the search bar?
- I'm afraid, this feature is not available and you're welcome to submit a feature request for this at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

3\ What is better to use in this case a toolset view or an Archive?
- The search field options work the same way in Views and in Archives. This decision would depend on exactly where you'd like to offer the search form. For regular pages, you'll use the views and on archive pages, you can use the WordPress Archives.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2352433

Hi Waqar,

2 and 3 are clear, thanks!

But for the filter I only want to show the options that are selected.
So for example on the demo page: hidden link
I selected Swimming Pool and Parking I only want to show the property who has a Swimming Pool and a Parking.
So in this example only the 3 bedroom detached house.

Hope this is clear.

Regards,

Michel

#2352661

Thanks for writing back.

On this property demo website, the "Amenities" are added as a custom field.

If you'd like to search through the "Amenities" so that only the results which contain all the selected options are shown, you'll need to add the "Amenities" as a custom taxonomy.

In a taxonomy search, it is possible to set the search type to either "All" or "Any", but in a custom field search, it uses only the "Any" operation.

#2353807

Hi Waqar,

I tested the taxonomy Property types but I can't find the search type.
Can you tell me where to find it?

#2353901
taxonomy-query-filter.png

You'll find the setting for the search type in the view block's "Query Filter" section.
( example screenshot attached )

In the taxonomy filter, you'll see that you'll have the option to select the search type to "any of the values", "not one of the values", or "all of the values".
( for your requirement, you'll need to select "all of the values" )

#2354127

My issue is resolved now. Thank you!