Skip Navigation

[Resolved] Need to filter with several value of the same custom field

This support ticket is created 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Pat 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1248591

Pat

Hello,

I have a radio custom field that could take 5 different values (Ateliers, Sorties, Conferences, Langues, Informatique)
I'm now building a Views that will be filtered by this custom field. But the result of the Views should display different values of the filter custom field (ie : Ateliers, Sorties, Conferences).

Is it possible to have this kind of working and how to format the Views shortcode :
[wpv-view name="backoffice-select-enseignement" recherche="Ateliers, Sorties, Conferences"]
or by defining directly the filter inside the Views?

Regards
Pat

#1248597
Screen Shot 2019-05-23 at 11.41.14 AM.png

You have to use the option "in" instead of "equal to" in the Query Filter. See the attachment here.

Then you can use either a shortcode attribute to specify the values, or you can predefine them in the Query Filter.

#1248923

Pat

Hi Christian,

Many thanks, that' working fine.
Just an additional question : this works if I use the fixed filter in the admin section. Is there a way to make it work thanks to a shortcode attribute like [wpv-view name="backoffice-select-enseignement" recherche="Ateliers, Sorties, Conferences"] and if yes, what is the structure of the needed parameters?

Regards
Pat

#1250209
Screen Shot 2019-05-26 at 10.32.25 AM.png

Yes, you can make it work with a shortcode attribute. The format depends on your checkboxes values. It is best if your checkboxes each have a unique value. For example, if your checkbox values are 1, 2, 3, 4, and 5 and you want the filter to show 1,2 and 4, then you can supply the desired values in the shortcode attribute like this:

[wpv-view name="backoffice-select-enseignement" recherche="1,2,4"]

The values for each checkbox can be found in the field editor. See the attachment here.

#1256941

Pat

Hi Christian,

Even if it is not working totally the same way than the one I was searching for (ie : shortcode parameter), I think I can manage that with your solution.

Many thanks
Pat