Skip Navigation

[Résolu] Problem with conditional output of non empty field

This support ticket is created Il y a 6 années et 9 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 réponse, has 2 voix.

Last updated by Noman Il y a 6 années et 9 mois.

Assisted by: Noman.

Auteur
Publications
#548442

I have this condition repeated many times for different fields something i do wrong as debug and view show empty:)
field slug sniadanie-opis

[wpv-conditional if="( NOT(empty($(wpcf-sniadanie-opis))) )" debug="true"]
<div class="diettext">
  [types field='sniadanie-opis' id="$dzien"][/types]
</div>
[/wpv-conditional]

####################
wpv-conditional attributes
####################
Array
(
[if] => ( NOT(empty($(wpcf-sniadanie-opis))) )
[debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( NOT(empty($(wpcf-sniadanie-opis))) )
--------------------
--------------------
Converted expression: ( NOT(empty('')) )
--------------------

#548450

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Kasper,

Thank you for contacting Toolset Support. The condition you are using is not so correct. Please use conditional like this:

[wpv-conditional if="( $(wpcf-min-pages) ne '' )"]
  Field Not Empty -- [types field='min-pages' format='FIELD_NAME: FIELD_VALUE'][/types]
  [/wpv-conditional]

I have tested this in the Content Template and this works fine at my end.
Thank you

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.