Skip Navigation

[Resolved] Conditional Block on content template does not render the Single Field.

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

Problem:

An unrendered shortcode shows on the front-end from conditional block of content template.

Solution:

This block contains unexpected or invalid content, you can try one of below options:

https://toolset.com/forums/topic/conditional-block-on-content-template-does-not-render-the-single-field/#post-1455445

Relevant Documentation:

This support ticket is created 5 years, 1 month 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 5 replies, has 2 voices.

Last updated by darshanP 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1450037

I am trying to: display a single field inside a conditional block on a content template.

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

I expected to see: The value stored in that custom field.

Instead, I got: An unrendered short code on the front end.

#1450291

Hello,

I assume we are talking about the shortcode [types field='category' output='normal' ][/types] in the URL you mentioned above.

I have tried it in my localhost, there isn't the problem you mentioned above.

Since it is a shortcode, please put it into a shortcode block, and test again.

Also check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

2) If the problem still persists, please provide database dump file(ZIP file) of your website, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1453727

Any update?

#1455413

I am downloading the files, will update here if there is anything found.

#1455445

Here are what I found, please edit the content template "single-incident-entry":
hidden link

in the problem row(just below text "Attachment"), you should be able to see message: this block contains unexpected or invalid content.

It conducts the problem.

I suggest you try one of below options:
1) Convert it to HTML block, and follow our document to setup the [wpv-conditional] shortcode
hidden link

For example:

[wpv-conditional if="  ( ( '[wpv-post-field name="entry_type" ]' = 'Request' ) ) " ]
...
[/wpv-conditional]

2) Follow our document to setup the conditional block, and test again.
https://toolset.com/documentation/user-guides/gutenberg/using-toolset-conditional-block/

#1460469

I was able to figure it out with your help.

Using the Toolset Layout Builder the conditional field does not work, you have to type it out manually using the short code.