Skip Navigation

[Resolved] Conditional display inside Post Forms based on my own shortcode

This support ticket is created 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 3 voices.

Last updated by andrei-laurentiuP 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1259133

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?

#1259147

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

#1259163

Should it be like:
//
[wpv-conditional if="( '[myshortcode]' gt '' )"]
Content
[/wpv-conditional]
//
?

#1259325

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?

#1259333

Yes, within a Post Form. The Toolset conditional display seems not to work.

#1259337

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/

#1259565

It works just fine! My issue is resolved now. Thank you!