Skip Navigation

[Resolved] Adding a default entry to multiple select search filters

This thread is resolved. Here is a description of the problem and solution.

Problem:

I would like my multiple select search filters to have a default entry of "Search All" selected

Solution:

The attribute "default_label" works only for the single select dropdown menu, it does not work for the multi-select field,

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy

This support ticket is created 6 years, 7 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.

Our next available supporter will start replying to tickets in about 8.49 hours from now. Thank you for your understanding.

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 9 replies, has 3 voices.

Last updated by daveG-7 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#751674

Hi. I would like my multiple select search filters to have a default entry of "Search All" selected. I know that searching all is the default functionality of the multiple select with no field selected, but that isn't obvious to users, so clicking on other options other than "Search All" to refine their search would be better user experience. Is there any way to implement this?

Thank you.

#752018

One thing to note - most of these filters will be for custom taxonomies. Thanks.

#756570

This is not possible.

Only a Dropdown or Radio Taxonomy filter can have an empty or a custom option to search "all" items.

What we could do is file a request to make it possible, but this needs to be evaluated first by Developers if they will implement this.

In custom fields, you can achieve the goal by passing "manually entered values" in the Filter of "multi-select" kind.
Empty values mean all values are returned in this case.

#772452

It does seem like if a filter for a custom field multi-select can do this, the filter for a taxonomy should be able to, too - from a user's point of view they won't know the difference, since the filters will otherwise appear the same. If you could ask the developers about it, I think it would be an improvement to the plugins.

On another site, I realized I'd solved this issue for custom fields with the filter paramatters: auto_fill_default="Any" auto_fill="wpcf-custom-field-title" auto_fill_sort="asc" - is this method possible with custom taxonomies?

#775624

Hello,

You can add default option to taxonomy select control, for example:
[wpv-control-post-taxonomy default_label="All" ...]

See our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy
default_label (opt):
'default option text'
Add default option like All or Any on taxonomy select control.

#787279

That doesn't seem to work with multi-select taxonomy filters. You can see it on this page: hidden link - password 2Jcnb}4gu?N-fXN!

The first multi-select filter, Resource Type, uses this shortcode: [wpv-control-post-taxonomy taxonomy="resource-type" type="multi-select" url_param="wpv-resource-type" default_label="All"] As you can see, no "All" option is added. When I used the same code on the checkboxes filter, Copyright Status, above, default_label="All" worked just fine.

#791055

There is a misunderstanding, the attribute "default_label" works only for the single select dropdown menu, it does not work for the multi-select field, it needs a feature request, see the answer:
https://toolset.com/forums/topic/adding-a-default-entry-to-multiple-select-search-filters/#post-756570

For your new question:

auto_fill_default="Any" auto_fill="wpcf-custom-field-title" auto_fill_sort="asc" - is this method possible with custom taxonomies?

No, those attribute does not work in the shortcode [wpv-control-post-taxonomy], see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy

There isn't such kinds of options.

#804344

Ok, thanks. I do think that if custom field multi-selects can have default text, taxonomy multi-selects should too, since for a front-end user of the site they are indistinguishable. Will you file that as a feature request, or should I?

#807886

I will forward it to Beta, he manages the feature request of Views plugin, our developers will evaluate it, but there isn't any ETA to implement it, you can subscribe to our blog to get the updated news.

https://toolset.com/blog/

#813541

Thanks. It's not urgent, but I do think it would be a good feature to add.