Skip Navigation

[Closed] Conditional test for empty field on parent

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.

This topic contains 3 replies, has 2 voices.

Last updated by Shane 4 years, 5 months ago.

Assigned support staff: Shane.

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

The topic ‘[Closed] Conditional test for empty field on parent’ is closed to new replies.