Skip Navigation

[Resolved] Content Templates can't run shortcodes that Layouts can

This support ticket is created 4 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 2 voices.

Last updated by scottL-3 4 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1546245

I am trying to:
Ultimately I am trying to retire Layouts from this site. Right now I am trying to convert a Single Product Layout to a Single Product Content Template along the way.

In the layout, I can use a shortcode to an Elementor template: [elementor-template id="8066"] to show product tab info in Elementor's tabs which the client far prefers to Bootstrap tabs or WooCommerce's own tabs.

If I re-create the layout in a Content Template, change the usage of the layout to not be for products and change the usage of the content template to be for products, everything works except this shortcode.

The tabs include shortcodes in each tab, some are custom shortcodes that retrieve things like Product Category descriptions, a CPT for product documents that is related to product and / or product category, the long product description ([wpv-post-body]), etc.

Link to a page where the issue can be seen:
I fixed this by going back to using Layouts for now as I can't leave the site broken.

We are preparing to move to a different host and the site that is setup there but not pointed to in DNS yet shows the problem. If you set stoneyard.com to 104.247.76.228 in a localhosts file, you can compare:
hidden link
which is now showing the correct output
to
hidden link
which does not show the tabs at all and does not run the shortcode to do so at all (I've tried inserting various debug code in the shortcode to see if it ever gets called).

I expected to see:
Product image and gallery next to product info and then product tabs underneath

Instead, I got:
No product tabs.

QUESTIONS:
Is this supposed to work or is there something fundamentally different about a Content Template that prevents it from executing the elementor-template shortcode?

Do I need to add the elementor-template shortcode in Third-party shortcode arguments or Functions inside conditional evaluations in order for this to work?

Is this because I'm trying to use a Content Template but Layouts is active?

I've tried this with all non-relevant plugins disabled and with a default theme with no change. There are no related errors in the error log if I enable WordPress error logging.

#1546855

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I do wonder that why you are using Elementor shortcode within Layouts or Elementor shortcode within content templates as that is not the suggested method at all.

Obviously - either you should use Layout + Content template build on top using Toolset or use Elementor where you should discard the use of Layouts. Please check this related ticket:
=> https://toolset.com/forums/topic/layouts-elementor-not-compatible/

Please review the limitations using Toolset with the Content template:
=> https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/create-templates-for-custom-post-types-with-elementor-and-toolset/#limitations-when-using-elementor-and-toolset-templates-together

#1547083

This has been in place and working since long before any of those other tickets. But also let me be clear: I am talking about Elementor Global Widgets or Saved Templates for sections, NOT Elementor theme builder post templates. We just need to use Elementor's tabs widget in our Toolset Single Product Layout or Content Template as our other options for mobile responsive tabs don't meet our needs. If we were starting today we would not use Layouts at all but this site was built nearly 3 years ago and now we're trying to move away from Layouts but still need Toolset WooCommerce Views capabilities so switching to Elementor Theme Builder for Single Product Templates isn't an option. We're also finding other things Layouts for Archives can do that that regular Views Archives can't do so we may not be able to leave Layouts after all.

To be clear, we do not use Elementor Theme Builder for page, post or archive templates at all. We only use it to design individual pages and to design some saved sections we use in multiple places on the site via shortcode and for the footer. We've never had a problem with Layouts and Elementor like the ones described in your first referenced ticket. The second ticket may be more where the problem lies ... in Layouts, our use of the elementor-template shortcode to pull in the saved section is not in a loop or content template but without Layouts we have to put it in the Toolset Content Template for the post type (still not in a View though as this is the Single Product Template).

But .. in our scenario, we're not doing anything different than using any shortcode in a content template would involve. Did Toolset do something in the code to ignore [elementor-template ...] shortcodes for safety's sake that may be affecting our use too?

#1547893

Minesh
Supporter

Languages: English (English )

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

Yes I understand and Toolset has integration with Elementro not with Elementor theme builder post templates or you can say Elementor themer.

As I shared with our official Doc that three is certain limitations using Elementor's shortcodes within the template or Layouts:
=> https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/create-templates-for-custom-post-types-with-elementor-and-toolset/#limitations-when-using-elementor-and-toolset-templates-together

As you will end by putting yourself in trouble when you do not follow the guides as the current case is one of the classic example of that. So, again - we do not advise you to use the Elementor's shortcodes within content template or Layouts as it may hurt you more in the future. You should find a way to build it either using Elementor or using Content template supported by Views.

#1548329

Thanks Minesh. It wasn't clear in that support article whether global widgets and saved templates were a problem or just theme builder templates that would more directly compete with content templates but it sounds like you're saying no kind of Elementor template should go in a Toolset content template. For us that would mean we'd have to switch to using Elementor for single post temlates completely which we don't want to do right now (or perhaps ever) so we'll have to stay with Layouts.

I'd appreciate it you'd let the Toolset dev team and Amir know that these kind of scenarios are going to make it very difficult for a lot of us to leave Layouts. Since Toolset has announced that Layouts won't be getting much attention going forward, we're nervous that it will eventually be dropped completely like the Toolset Starter theme was. It'd be nice to have some re-assurance that Layouts will be supported, if not enhanced, for many years to come.

You can close this ticket.

#1549633

Minesh
Supporter

Languages: English (English )

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

Yes - I understand your concern and Layouts plugin going to be supported and we are going to keep it in maintenance mode (if we are not going to add new features to it as we are more focused on the Toolset Blocks) and we will keep supporting Layouts. Please feel free to close this ticket.

#1549809

Thanks for the explanation.