Skip Navigation

[Resolved] Divi Global Module with nested shortcodes

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

Problem: I am trying to use nested shortcodes in a Divi Global Module, but it doesn't seem to work. The same shortcodes work in a standard module.

{!{wpv-conditional if="(NOT(empty($(wpcf-activity-adult-price))))"}!}
<h2>Price from: [types field='activity-adult-price']€ p.p.</h2>
{!{/wpv-conditional}!}

Solution: We are collaborating with Divi for a solution to this problem.

This support ticket is created 6 years, 4 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
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)

Tagged: 

This topic contains 11 replies, has 3 voices.

Last updated by Puntorosso 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1069260

Hi, some news concerning Types shortcodes not working in Divi Global Modules?

Thanks

Best

#1069360

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for contacting our support forum.

When you say doesn't work, is it that the area where it should show up is displaying blank ?

I suspect that this is so because the shortcode is rendering the information by getting the id of the current page that is being displayed.

Lets say you are viewing the homepage and this global module is rendered on the hompage. If the homepage doesn't have the custom field that the shortcode should be rendered then nothing will appear.

What you can do is to manually pass the id into the shortcode by using the shortcode attribute id='1234' where 1234 is the id of the post.

Please let me know if this helps.

Thanks
Shane

#1069397

Hi,
no I mean that while Toolset shortcodes are working perfectly in a Divi Text module, they won't be recognised anymore once this module has been turned "Global".

You can see it yourself here

hidden link

left the normal module and right the same one saved as Global.

As this is a site I use only to test bugs etc. you can login and do whatever you need.

Thanks

Best

#1069482

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Not sure why it doesn't work with the new method but adding the shortcode like this works.
[types field='activity-adult-price' format='FIELD_NAME: FIELD_VALUE'] [/types]

Thanks,
Shane

#1069565

Hi,

that means I cannot use the shortcode generator?
Even the conditional shortcodes generated by Types are useless then.

I have tried to substitute the new "{!{" with the old "[" but it doesn't work.

You can check it in the same site/page.

Thanks

Best

#1070339

Hi, Shane is on public holiday today so I'll try to help. I can see that our team created an issue ticket with the Divi team regarding nested shortcodes and global modules, but I don't have any updates on fixes for shortcodes in global modules yet. Can you share the full contents of the module? I would like to see how your markup and shortcodes are structured.

#1070429

Hi,

This code works in a normal module

{!{wpv-conditional if="(NOT(empty($(wpcf-activity-adult-price))))"}!}
<h2>Price from: [types field='activity-adult-price']€ p.p.</h2>
{!{/wpv-conditional}!}

but it doesn't when turned to Global.

The same if I use the old style

[wpv-conditional if="(NOT(empty($(wpcf-activity-adult-price))))"]
<h2>Price from: [types field='activity-adult-price']€ p.p.</h2>
[/wpv-conditional]

Do you want an access to try it directly in my test site?

Thanks

Best

#1071470

Sure, but I see in the code you provided the closing Types field tag is missing. Please add the closing tag to the Types field shortcode, since it's required:

{!{wpv-conditional if="(NOT(empty($(wpcf-activity-adult-price))))"}!}
<h2>Price from: [types field='activity-adult-price'][/types]€ p.p.</h2>
{!{/wpv-conditional}!}

If that does not resolve the problem where the opening Types field shortcode is written to the page, please provide login access in the private reply fields here.

#1071556

Okay thanks, I'm able to replicate that problem in a local test and I've asked my 2nd tier support team to confirm whether or not it's caused by the same issue - nested shortcodes are not working in Divi Global modules. If it's the same, there's not much we can do until we get some collaboration from Divi. We created this issue ticket, which has not been addressed yet: hidden link

I'll let you know what I find out about the shortcodes in conditionals problem.

#1074269

Okay I received confirmation from my 2nd tier support team that this problem is a symptom of the same issue we raised with the Divi team. We're waiting for their collaboration so we can resolve this problem.

#1228744

I encourage you to report this issue to Divi if you have not already done so. Please include a link to this erratum post: https://toolset.com/errata/shortcodes-with-attributes-populated-by-shortcodes-are-not-evaluated-properly-in-divi-global-modules/

#1229041

Done.
Let's see how the Divi dev react.
Thanks

Best