Navigation überspringen

[Gelöst] Shortode within conditional shortcode breaks

This support ticket is created vor 1 years, 7 months. 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 reply, hat 2 voices.

Zuletzt aktualisiert von Minesh vor 1 years, 7 months.

Assistiert von: Minesh.

Author
Artikel
#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>[wpml-string context="wpv-views"]REGISTER[/wpml-string]</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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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!