Skip Navigation

[Resolved] Using nested shortcodes in Elementor widget

This thread is resolved. Here is a description of the problem and solution.

Problem: I'm trying to use a shortcode in a View's shortcode attribute. If I test the nested shortcode outside the View it works as expected, but when I place the two shortcodes in an Elementor shortcode widget it's not working as expected.

Solution: Use a text editor element for best results with nested shortcodes.

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

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

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by geraldM 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1265779

I am trying to display a view within an Elementor shortcode widget as follows:

[wpv-view name="product-view" ids="[get_upsell_ids]"]

The custom shortcode [get_upsell_ids] on its own works fine and gives a list of IDs of upsell-products for the current post. Adding the above line directly into another Toolset view also works as expected.

But inside the Elementor widget, something seems to break when nesting shortcodes. The 'ids' parameter is ignored and "] is appended after 'products-view' is done listing all products.

Bug?

#1265935

I'm not sure about Elementor specifically, but in Toolset you need to register nested 3rd party shortcode arguments. Go to Toolset > Settings > Front-end Content and scroll down to 3rd party shortcode arguments. Register get_upsell_ids to be able to use it as a shortcode argument.

#1266449

Thanks, Christian!

The custom shortcode is registered and the whole nested shortcode works fine in any other context. Only when put into the widget, it fails. Perhaps this is a problem with Elementor? Should I contact their support?

#1266683

First I would try this in a Text editor element instead of a shortcode element. If it still doesn't work that way, you may need to contact Elementor support.

#1266833

Thank you! The text editor widget works. I wasn't aware that it processed shortcodes.