I have created my own shortcode. Sometimes it provides a link, sometimes it returns empty. I would like to display a specific text inside the post form if that shortcode displays the link. Is it possible to do it with the current Toolset arrangement?
Hello,
It is possible with Views shortcode [wpv-conditional], you can use it to check if your custom field value isn't empty, then display specific text/content. See our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
Checking fields and other elements for Empty/Non-empty Values
Should it be like:
//
[wpv-conditional if="( '[myshortcode]' gt '' )"]
Content
[/wpv-conditional]
//
?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello, This is Minesh here.
Well - from what I see Luo asked you to use [wpv-conditional] shortcode but you want to display conditional output within Toolset form - correct?
Yes, within a Post Form. The Toolset conditional display seems not to work.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Please try to use the following code - within forms you should try to use the [cred_show_group] shortcode :
[cred_show_group if="( '[myshortcode]' ne '' )" mode="fade-slide"]
display your message here
[/cred_show_group]
More info:
=> https://toolset.com/documentation/user-guides/cred-conditional-display-engine/
It works just fine! My issue is resolved now. Thank you!