Skip Navigation

[Resolved] Problem with conditional output of non empty field

This support ticket is created 6 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
- 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 reply, has 2 voices.

Last updated by Noman 6 years, 8 months ago.

Assisted by: Noman.

Author
Posts
#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: English (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.