Skip Navigation

[Resolved] Content Template Shortcodes Not Fully Parsed

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

Problem:

Types shortcodes does not work inside the nested [wpv-conditional] shortcode.

Solution:

Move all codes(content) within [wpv-conditional] shortcode into a content template, for example:

[wpv-conditional if="( $(wpcf-profile-status) eq '1' )"]
[wpv-post-body view_template="person-individual-detail-status-1"]
[/wpv-conditional]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

This support ticket is created 6 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
- 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 3 voices.

Last updated by chuckH 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#751630
shortcodes-not-parsed.png
shortcodes-parsed.png

I am trying to:
Display a page using content templates and shortcodes. However, not all of the shortcodes get parsed.

Link to a page where the issue can be seen:
hidden link (shortcodes NOT completely parsed)

I expected to see:
hidden link (shortcodes parsed)

Instead, I got:
hidden link (shortcodes NOT completely parsed)

Thank you for your help to troubleshoot and resolve the issue.

#756542
Bildschirmfoto 2018-04-28 um 11.50.34.png

In the Content Template, there is something wrong with the Syntax.
Please see the screenshot.
You notice the "reddish" highlighting?
Those speak for broken HTML syntax.

1. "ol"/"ul" elements are not legally allowed inside "p" elements.
That is why you have a wrong syntax highlight at each:

<p class="resume-section" id="employer">
  <ul>
  [wpv-for-each field="wpcf-profile-employment"]
    <li>[types field='profile-employment'][/types]</li>
  [/wpv-for-each]
  </ul>
</p>

2. That is what breaks the 3 last DIV as well.

Hence this is something that needs to be resolved.

It seems moreover this happens only with that one person?
It may be that the values of one of the fields saved for that single person hold specific values that break the ShortCodes.

I checked other persons and they seem to look all good.
Can you confirm this?

In that case I suggest to try producing a new post for that one single "broken" person post.

#774513

Thank you for having a look.

I fixed the HTML validation issue (i.e. "ol"/"ul" elements are not legally allowed inside "p" elements) you described. I recreated the post. The issue still exists. In addition, it is not restricted to that one post. There are others, for example:

hidden link
hidden link

Here is the index page with all of the entries:
hidden link

#775627

Hello,

The problem you mentioned above is abnormal, and I have tried the credentials you provided, it is not valid, I get this error:
ERROR: Invalid username.

So I can not check it in your website.

In case it is a compatibility problem, please try this in your website:

1) deactivate other plugins and switch to wordpress default theme, and test again

2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL, I need to test and debug it in my localhost, thanks

#780996
#783020
rosa_furneaux.JPG

Here are what I found:
There isn't the similar problem with your database dump file + the latest version of Toolset plugins, see screenshots:
rosa_furneaux.JPG

So it should be a server problem or compatibility problem, To debug this problem, I need your permission to deactivate plugins/theme in your website, please backup your website first, thanks

#789634

Hi. Please feel free to deactivate plugins/theme in our website. As I previously mentioned, it's a staging (NOT production) site.

I recently updated our web server from PHP 5.x to 7.x. However, I do not know whether the problem existed before the PHP upgrade.

#791032

Thanks for the details, here are what I found in your website:
In the content template "Person - Individual Detail"
hidden link
You are using nested wpv-conditional shortcodes, it conduct the problem, I have done below modification in your website

1) Move all codes(content) within $(wpcf-profile-status) eq '1' to a new content template: "Person - Individual Detail status 1"
hidden link

2) Edit the content template "Person - Individual Detail", inside $(wpcf-profile-status) eq '1', display only the above content template shortcode, like this:

[wpv-conditional if="( $(wpcf-profile-status) eq '1' )"]
[wpv-post-body view_template="person-individual-detail-status-1"]
[/wpv-conditional]

Please test again, check if it is fixed or not. thanks

#805673

Thank you for your help to solve the problem!

I was unaware of the issue with having nested wpv-conditional statements. It might help others to update the documentation on the page below:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

Thanks again!