Skip Navigation

[Resolved] how to use conditional output to use unseen value (if value =X, other value=Y)

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 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1247355

Hi,

I am trying to use conditional so when user has selected a value, this value and another one is applied to the filter:

[wpv-conditional if="( $(etat) eq 'Neuve' )"]
[wpv-control-postmeta field="ville" values="Rimouski" url_param="wpv-ville"] //his is probably where i'm wrong//
[/wpv-conditional]

So, if user selects "Neuve" in "etat" field, i would like the field "ville" to be set to "Rimouski".

If "Neuve" is not selected, then the field "ville" stays empty

The (wpv-ville) is set in the filters but is not seen by user. I tried Ville equal to constant "Rimouski" but i can't put it in the conditional output

What am i doing wrong and is there a better way to do this?

thanks a lot

#1247359

Hi, conditionals aren't meant to be used in a View's filters. They are meant to be used in the context of a post, or a post within a View. There's not currently a way to programmatically select or manipulate custom field filters based on other custom field filter selections. The exception to that is the feature "Limiting Filter Inputs According to Available Results", which is explained here: https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/

Further customization of custom field filters would require custom code. Let me know if you have additional questions about that.