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.
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
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
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.
Hi Waqar,
I tested the taxonomy Property types but I can't find the search type.
Can you tell me where to find it?
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" )
My issue is resolved now. Thank you!