Skip Navigation

[Resolved] Conditional string for empty field not working

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

Problem:

The issue here is that the user wanted to check if a custom field is empty.

Solution:

This can be done by following the instructions in the link below.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

This support ticket is created 6 years, 1 month 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 4 replies, has 2 voices.

Last updated by alexandreG-2 6 years ago.

Assisted by: Shane.

Author
Posts
#1133362
Screenshot of René Bégin - Lemieux Nolet.jpg

I am trying to hide a field label when there is no data in the respective field

Link to a page where the issue can be seen: hidden link

I expected to see: On this page, the label "Implications et reconnaissance" should be invisible as nothing is in this CPT field
There is already a conditional string for the "Télécharger le Curriculum Vitæ de René Bégin" field just underneath the picture. This conditonal string is working when there is nothing in this field.

Here's the code I have used for the "Télécharger ..." field :
[wpv-conditional if="( $(wpcf-c-v) ne '' )"]
... html...
[/wpv-conditional]

I have tried the same code for the "Implications ..." field, changing the name of the field and it's not working.
I did try doing with the GUI and also variants suggested in forums and support threads, Nothing will work.

I'm using this code in a content template called "Modèle pour Équipe" made with Visual Composer.

Thansk for any support

#1133733

Shane
Supporter

Languages: English (English )

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

Hi Alexandre,

Thank you for contacting our support forum.

I've managed to fix the conditional that you were having issues with, so the text should no longer show up unless the field has a value inside it.

Thanks,
Shane

#1133753

Thanks Shane for your support,

Is it possible to know what was wrong ? I did enter exactly what you have entered nad it did not work !!

Thanks again

#1133757

Shane
Supporter

Languages: English (English )

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

Hi Alexandre,

Actually not sure as all I did was to change the EQ to NE

#1135963

My issue is resolved now. Thank you!