Skip Navigation

[Resolved] Fields Do Not Render Correctly

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

Problem:
The user has configured a content template, but some of the fields do not render in the frontend.

Solution:
It turns out that the user was using a conditional with a big content inside. Currently, we have a limitation on the content of a conditional block and we need to keep it under a certain limit.

Relevant Documentation:
https://toolset.com/errata/shortcodes-in-conditionally-displayed-content-may-not-be-executed-on-the-front-end/

This support ticket is created 3 years, 6 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Andrea 3 years, 6 months ago.

Assisted by: Jamal.

Author
Posts
#1786839
test-1-one-urls.png
test-1-two-urls-no-content.png
test-1-no-urls.png
test-1.png

I am trying to:

Link to a page where the issue can be seen:
hidden link
hidden link

I expected to see:
There are six fields below the image that should render an assortment of phone numbers, email address, and URLs.

Instead, I got:
Fields below the image do not render. After so many fields are added to the grid below the image, all the fields stop rendering text (and instead render the shortcode).

This view was rebuilt several times and the same results. The issue seems to always occur with the URL fields on the right side. I've enabled debug on both the IF conditions and the Views debug, but unable to interpret what the issue is. My assumption has been there is a stray character that is causing havoc, but why all the field content disappears is perplexing.

If you remove the 3 URL fields on the right, the phone/email fields on the left will render. Add one field back to the right side, it should work. Add another, it may still render correctly (but sometimes fails). Adding a third field never renders correctly and always causes all fields below the image to rendering the content. Remove the fields, one by one and eventually the other fields will render correctly.

I have also tried not using Conditional IFs on the URL fields, but this does not solve the issue. I have tested several other factors as well like excluding the CSS styles, adding different field types after the second URL, and others.

On hidden link you can see the styled output which shows empty space where the field data is expected

On hidden link you can view the non-styled output which shows the shortcodes where the field data is expected.

This is a staging copy so you may modify as necessary. The same fields, data, templates, views already exist in production with same issues.

#1787933

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

I think the issue is because you are wrapping too many conditionals and content inside one parent condition, check this screenshot hidden link
And this way you are reaching a PHP limit that we have documented in the known issue https://toolset.com/errata/shortcodes-in-conditionally-displayed-content-may-not-be-executed-on-the-front-end/

You will need to use the fewer size of the content inside the parent condition or increase the limit on your server.

I can also suggest creating another content template and putting all the child conditions inside of it, then using it inside of the parent condition, but that might not work too, because it will get the same size of the content.

I hope this helps. Let me know if you have any questions.

#1788163

Hi Jamal. That restriction is interesting. I've re-organized the template to add conditionals on the individual items rather than the group. Its a bit counterintuitive to "program" that way but it works. The end result is a few extra empty divs for some records which is manageable, I suppose. Thanks for the help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.