Navigation überspringen

[Gelöst] Conditional display based on two values in Blocks

This support ticket is created vor 4 Jahren, 12 Monaten. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 4 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Nigel vor 4 Jahren, 12 Monaten.

Assistiert von: Nigel.

Author
Artikel
#1486137

I'm currently trying to convert a product-archive that has benn created using shortcodes to the new toolset blocks.
I have a condition that is based on two values:
[wpv-conditional if="( '[types field='schutzart-ip' option='8'][/types]' eq 'IP66' ) AND ( '[types field='schutzart-ip' option='9'][/types]' eq 'IP67' )" debug="false" ]
<i class="et-check">[wpml-string context='wpv-views']staubdicht, gegen starkes Strahlwasser und Tauchwasser geschützt[/wpml-string]
[/wpv-conditional}!}

If product has the the values IP66 and IP67, show "text"

I can not get this to work using toolset blocks.

I have tried to create a conditional group and I have tried nested conditions.

####################
wpv-conditional attributes
####################
Array
(
    [if] =>   ( ( $(wpcf-schutzart-ip) = 'ip67' ) ) 
    [debug] => true
)

####################
Debug information
####################
--------------------
Original expression:   ( ( $(wpcf-schutzart-ip) = 'ip67' ) ) 
--------------------
--------------------
Converted expression: ( ( 'ip66' = 'ip67' ) )
--------------------
####################
wpv-conditional attributes
####################
Array
(
    [if] =>   ( ( $(wpcf-schutzart-ip) = 'ip66' ) ) 
    [debug] => true
)

####################
Debug information
####################
--------------------
Original expression:   ( ( $(wpcf-schutzart-ip) = 'ip66' ) ) 
--------------------
--------------------
Converted expression: ( ( 'ip66' = 'ip66' ) )
--------------------
#1486723

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

What kind of field is the schutzart-ip field?

A checkboxes field?

#1486887

multiple checkbox field

#1487071

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Sorry, I'm having trouble getting this to work with classic Views on my own site, I need to keep testing, but I have run out of road today, so I will update you in the morning.

Thanks for your patience.

#1488131

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

OK, I have it working now.

I was able to confirm on my test site that when used inside a conditional statement you need to check against the value saved in the database and not the display value, so ip66 for example and not IP66.