Skip Navigation

[Resolved] Shortode within conditional shortcode breaks

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.

Our next available supporter will start replying to tickets in about 0.54 hours from now. Thank you for your understanding.

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 1 reply, has 2 voices.

Last updated by Minesh 1 month, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2688364

I have a few conditionals in a CPT which uses Elementor as template. I am using the shortcode widget in elementor to add the following shortcode + text

<span style="color:white">

[wpv-conditional if="( $(wpcf-registration-status) eq 'open' )"]

[wpml-string context="wpv-views"]
To secure your spot at the event, simply click on the link provided and complete the registration process. Once your registration is confirmed, we will send you all the necessary information for the event.
[/wpml-string]

<h3><a href="[types field='product-url' output='raw'][/types]?ticket_type=[types usermeta='what_are_you' current_user='true'][/types]&member=[wpv-user field="display_name"]&email=[wpv-user field="user_email"]">[wpml-string context="wpv-views"]REGISTER[/wpml-string]</a></h3>

[/wpv-conditional]

[wpv-conditional if="( $(wpcf-registration-status) eq 'closed' )"]<h3>This event is currently closed for registration</h3>At the moment, registration for this event is not available. However, you can sign up for our notification list by clicking on the blue button below. Once registration opens, we will inform you promptly.<br />[gravityform id="5" title="false" description="false" ajax="true"][/wpv-conditional]
[wpv-conditional if="( $(wpcf-registration-status) eq 'sold-out' )"]<h3>Sorry! This event has sold out</h3>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-registration-status) eq 'waiting-list' )"]<h3>Join the waiting list</h3>[/wpv-conditional]
</span>

However, the part between the <h3></h3> tag breaks when it comes to the URL. Instead of the fields from the database, I am getting the full shortcode in the URL instead breaking the link. Everything else works like a charm.

Any idea whats wrong?

#2688437

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What you should do is:

1) Create a new content template "ct-for-shortcodes-handling" in legacy mode from:
=> Toolset => Content Templates (Don't assign the content template to any post type)
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

2) Add the content you shared with us to this content template and save the content template

3) Add the following shortcode to your Elementor's shortcode widget:

[wpv-post-body view_template="ct-for-shortcodes-handling"]

More info:
- https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153372

#2688530

Bro... I really don't know why i didn't do this in the first place. Ive done it dozens of times lol. I'm loosing my mind.

Thanks a million!

triggeru571 confirmed that the issue was resolved on 2024-03-19 04:12:00.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.