I have a CPT "Produkt" (products) with a URL-field "Testpage". Also there is a CPT "Angebot" (deal) with a many to many relationship to "Produkt" as child. I made a view where I show "Angebot" from one parent "Produkt". I try to test if the related "Produkt" field "Testpage" is empty or not.
####################
wpv-conditional attributes
####################
Array
(
[if] => ( '<em><u>hidden link</u></em>' ne '' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( '<em><u>hidden link</u></em>' ne '' )
--------------------
After replacing 1 general variables and comparing strings: ( '<em><u>hidden link</u></em>' ne '' )
Comparing <em><u>hidden link</u></em> to
Here is a page where I test my code, with a first product "WP Rocket" where there is an empty Testpage-URL and all following product have an non-empty Testpage-URL:
I tried this before without success, but I implemented it for you in the view:
<p>2. Testvariante (wpcf-testpage Test empty):</p>
<p>
[wpv-conditional if="( empty($(wpcf-testpage).id(produkt)) )" debug="true"]This field is empty or does not exist[/wpv-conditional]
[wpv-conditional if="( NOT(empty($(wpcf-testpage).id(produkt))) )" debug="true"]This field is not empty[/wpv-conditional]
</p>
The result I got is always "This field is empty or does not exist".