Skip Navigation

[Resolved] Conditional in custom field

This support ticket is created 5 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1226364

Hi,
I'm tryng to add a condition to custom field.
I added this:

($(tipologia-partenza) eq 2)

But it does not work because I need to set the field "tipologia-partenza" as raw value.

How can I do?

#1226471

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Domenico,

This is for the views conditional correct?

Is this the entire conditional statement ? or is this the conditional statement used in the Field Groups section.

Please clarify for me Also what kind of field is the "tipologia-partenza", could you send me a screenshot of the field structure in the edit field group page?

Thanks,
Shane

#1226472
Immagine2.jpg
Immagine1.png

Hi Shane, no it is for custom field conditional display.

If I use the code as sent it does not work because the value returned is a sentence "Partenza a scelta del cliente" as you can see in immagine2.

I need to "transform" it in raw value (2).

#1226532

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-04-05 at 3.15.08 PM.png
Screenshot 2019-04-05 at 3.15.00 PM.png
Screenshot 2019-04-05 at 3.14.48 PM.png
Screenshot 2019-04-05 at 3.14.39 PM.png

Hi Domenico,

This should work fine since the value of the field is what will be returned in the conditional, so having
($(tipologia-partenza) eq 2) is correct.

If it doesn't work then that is quite strange as I just test this with a select field as well. See Screenshots.

Would it be possible to gain access to the site to view this for you ?

Thanks,
Shane