Skip Navigation

[Gelöst] Conditional test for empty field on parent

This support ticket is created vor 6 Jahre, 11 Monate. 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
- 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 Antworten, has 2 Stimmen.

Last updated by Shane vor 6 Jahre, 11 Monate.

Assisted by: Shane.

Author
Artikel
#527175

I am trying the following:

[wpv-conditional if="( NOT(empty( $(wpcf-course-assessment-and-certification).id(courses) )) )" debug="true"]
<h3>Assessment and certification</h3>
[types field="course-assessment-and-certification" id="$courses"][/types]
[/wpv-conditional]

The field $(course-assessment-and-certification) does have a value on the parent course, but the NOT and EMPTY do not resolve. I was unable to use the standard "eq" as the value of $(course-assessment-and-certification) contains both ' and " characters...

How do I get

if="( NOT(empty( $(wpcf-course-assessment-and-certification).id(courses) ))

to evaluate as true?

#527220

Shane
Supporter

Languages: Englisch (English )

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

Hello,

Thank you for contacting our support forum.

Could you send me the debug data for this so that I can have a look. I see that you set debug to be true so there should be some debug data showing on the frontend.

Thanks,
Shane

#527230

hidden link

I get the following debug:

####################
wpv-conditional attributes
####################
Array
(
    [if] => ( NOT(empty( ($(wpcf-course-assessment-and-certification).id(courses)) )) )
    [debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( NOT(empty( ($(wpcf-course-assessment-and-certification).id(courses)) )) )
--------------------

however if I just run [types field="course-assessment-and-certification" id="$courses"][/types] I can see the data...

#527252

Shane
Supporter

Languages: Englisch (English )

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

Hello,

I would recommend evaluating it as a temporary workaround, however I did my own evaluation of a case like this and it works.

Could you let me know the type of field that you are checking in the conditionals so I can test that case as well as a sample text.

Thanks,
Shane

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