Skip Navigation

[Resuelto] types field shortcode not working inside a conditional

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 6.17 hours from now. Thank you for your understanding.

This topic contains 6 respuestas, has 2 mensajes.

Last updated by Tim Elliott hace 1 año, 12 meses.

Assigned support staff: Shane.

Autor
Mensajes
#1401581

I am trying to:
Display a types field inside a conditional statement in a content template.

Link to a page where the issue can be seen:
hidden link
You may need to log in to see the problem as it's a development site.

I expected to see:
hidden link
Armenian

Instead, I got:
[types field='education-pack-0-6' output='raw'][/types]
[types field='country-language-name'][/types]

Strangely, if I place the URL shortcode in like: <a href="[types field='education-pack-0-6' output='raw'][/types]">link</a> the link URL comes out as it should.

So testing with this code in the content tamplate:

Outside conditional<br>
[types field='education-pack-0-6' output='raw'][/types]<br>
<a href="[types field='education-pack-0-6' output='raw'][/types]">test</a><br>
[types field='country-language-name'][/types]<br>
[wpv-conditional if="( NOT(empty($(wpcf-country-language-name))) )"]
  Inside conditional<br>
  [types field='education-pack-0-6' output='raw'][/types]<br>
  <a href="[types field='education-pack-0-6' output='raw'][/types]">test</a><br>
  [types field='country-language-name'][/types]
[/wpv-conditional]

The output is:

Outside conditional
hidden link
test
Armenian
Inside conditional
[types field='education-pack-0-6' output='raw'][/types]
test
[types field='country-language-name'][/types]

And both of the test links have the fully rendered URL in the link.

#1401773

Shane
Supporter

Languages: Inglés (English )

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

Hi Tim,

Thank you for getting in touch.

We have been experiencing quite a few issues with Divi lately. To check if the issue is coming from divi I would recommend that you temporarily swap the theme to one of the wordpress default themes and let me know if the issue is still present.

Looking forward to hearing from you soon.

Thanks,
Shane

#1401867

Thanks Shane.

It's still giving the same output using 2019 or 2020 themes.

#1402927

Shane
Supporter

Languages: Inglés (English )

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

Hi Tim,

I must apologize for the delay in response as the forums are closed on the weekends.

Would you mind if I grabbed a copy of the site to investigate this issue for you further ?

Thanks,
Shane

#1402961

That's fine. You have access so feel free to install Duplicator and make a copy

#1403333

Shane
Supporter

Languages: Inglés (English )

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

Hi Tim,

The problem seems to be that there are too much shortcodes on the page to render.

What you can try is to increase your php suhosin value.

Have a look at the link below and let me know if this helps.
hidden link

Thanks,
Shane

#1404755

My issue is resolved now. Thank you!

I fixed it by putting the contents of the conditional into a separate content template and embedding the shortcode to the new content template in the conditional.