Skip Navigation

[Resolved] fields not display in Content Template

This support ticket is created 4 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 8 replies, has 2 voices.

Last updated by Beda 4 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#1542495

This site has been up for years working great.

Now things are breaking.

I did a Loom video to explain: hidden link

<removed personal data from public forum>

thanks so much.

#1542959
Bildschirmfoto 2020-03-07 um 16.29.59.png

This is very unlikely an issue that appeared recently due to Toolset.

It seems you use syntax that is not working for a long time in page builders.
Generally, it should produce {!{shortcode}!} in a page builder, instead of [shortcode]

So I think that is the major issue, but it's strange that you say this worked up and until a week ago, as there were no updates of a kind that could break this feature.

I've logged in to the site and tried to edit hidden link, which shows me a blank page, see screenshot

It seems, there are underlying issues that make it impossible for me to even edit the Template.
At this point, I've to suggest migrating the site on a Staging site for tests and updates (unless you've one already)

In any case, I suggest outputting only [wpv-post-title] on the Spanish chapter post.
See what it puts out precisely, then compare to that in the HTML conditional

BTW if the HTML conditional hidden content comes close to 1500 characters, which a Form can be very quickly, the conditionals might break:
https://toolset.com/errata/shortcodes-in-conditionally-displayed-content-may-not-be-executed-on-the-front-end/

Can you test what post title shortcode outputs, and be sure to compare the right values?
If that brings no solution, is it possible to bring this site onto a testing server, where we can pick it apart so to exclude third party influence?

Thanks!

#1545113

Hi Beda - thank you for your reply. I have no idea why you were unable to view that page for editing. Worked fine for me?

I tried outputting only the [wpv-post-title] on the Spanish chapter post as you suggested. It did not work.

As for the syntax, I'm using the Toolset GUI to create those conditionals so not sure how syntax would be incorrect?

I'm in the process of creating a staging site so you all can look around further. I'll be back to you when that's done.

thanks!

#1545151

Staging site is at hidden link

Same login credentials as before.

Can you please take a look at

1. Why the conditionals for the Spanish chapter aren't working for the contact form
2. Why the Leadership profile for Ken Lander doesn't show up on either Guatemala or Costa Rica

thanks so much!

#1545213

Interestingly the editor now worked for me as well.

I've checked why the conditional doesn't execute on hidden link, and I see on that post only the part below "REGÍSTRATE AL RETIRO" displays.
That's unexpected because for that post, "First Time Attendee Registration Link" field is not empty. But the condition executes as it would be empty.

That should be because there is broken syntax in the Builder
When editing the section in text mode you'll see that it encompasses the condition in a span, that is never opened outside the condition.

[wpv-conditional if="( $(wpcf-first-time-attendee-registration-link) ne '' )"]NOT EMPTY<span style="font-family: system-ui, '---apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;">[/wpv-conditional]</span>

(note, I replaced your content with NOT EMPTY so to see if it works)

So if you change that to:

[wpv-conditional if="( $(wpcf-first-time-attendee-registration-link) ne '' )"]NOT EMPTY[/wpv-conditional]

It would work

I then noticed you also mix languages on each post and I am not sure how you control that output, the fact is, English (above) is not output at all here.
So we can forget about that section on this page.

The next section, "REGÍSTRATE AL RETIRO", seems to show fine, right?
Then again "¿PREGUNTAS? ¡CONTÁCTANOS!" is not shown, but neither is its English pendant, and since this is not how a Website is usually translated I do not know how you decide where to display what, there are no conditions or else determining when to display English or Spanish.
In the condition itself, however, I highly encourage using wpv-post-slug, NOT the title, because the title might hold special characters, and is not a safe mode to use.
Using the slug, you can be sure to check on the precise machine-readable string.
So instead of the existing, you could use

[wpv-conditional if="( '[wpv-post-slug]' eq 'latam-costa-rica' )"][wpv-post-title][/wpv-conditional]

That works fine (note, on the duplicate staging site I removed other conditions to check each single one)
I also inserted the conditions in the Text mode to avoid any syntax issues.

Can you try this on the live site?
Making sure no syntax issue sneaked in, by changing to text editor mode, and checking on the Post SLUG instead of title?

About the "Leadership profile for Ken Lander doesn't show up on either Guatemala or Costa Rica", can you ensure it is not due to the same issue?
I see only the Chapter Leadership Bio 2 is shown, the Chapter Leadership Bio 1 is not.
Actually the whole section isn't displayed as on the other posts and again I am not sure, how you even determine when to display Spanish or English, as that is exactly the issue here it seems, the Spanish is not shown!

This could be due to any condition BEFORE that content, either misconfigured or syntax-broken.
This can then affect subsequent ShortCode.

What I suggest here is this:
On the staging site remove all content from that template.
Ensure you know how to display different content for different languages (this usually requires proper translation, like with WPML)
Then, after this works (the headings are shown in all languages as expected) insert shortcodes (what you want to display) and check that works
Then, wrap that content back into the conditionals used.

It will show where the error relies in, but will be a time expensive task. Unfortunately, there is no other method to check why the conditions fail in this case, as the content is very intricate, and not translated in any to me known method.

Maybe if we know why not even the heading is shown I think we can figure out why the rest isn't shown. That part doesn't depend on conditionals, hence there must be maybe some custom code or else handling this?

Last, are you sure this started after an update?
The way the conditionals are added (see above) this can never have worked fine.
Can you recall under what Toolset Version this worked?
We could simply roll back to see it working, then start from there by an update, to confirm this. That would then be a bug and I'd escalate it to the DEV to fix, but for now, it looks like a misconfiguration of the shortcodes and HTML.

#1546243

Hi Beda - thank you for your thorough answer.

1. The live site does not have spans within the conditionals anywhere at all, even in text mode.
2. I copied/pasted your conditionals to show the post title right into a new text module in text mode on the live site. Didn't work.
3. The headers are conditioned to show either English or Spanish based on the taxonomy of the post. It's either taxonomy "Spanish" or no taxonomy for English sites. This is the same for the leadership header that isn't working and for the other headers that are working. They are all conditioned exactly the same but only the Leadership header is broken.

I am truly stumped and don't know what to do. I'll try your suggestion to rebuild it all on the staging site, but it seems that the live site is behaving differently from staging. I'm confused. And frustrated.

#1546597

Where is that condition set, of the languages? It is not done with HTML conditions, as far I see?

Also, the conditions that I suggest, they worked on the testing site.
It's visible on the link here hidden link

Indeed the live site seems different than the staging site, meaning, it's not a precise copy, or maybe another server/plugin/Theme is interfering, or some cache, htaccess or else settings are different

What I suggest here is to narrow the possible sources for issues down.

Taking what we know:
- most posts work fine with the current setup
- the only posts showing issues are those with a specific different language
- language is not defined by any HTML or Toolset features, as far I understand, but some custom or 3rd party method to use Taxonomies for Languages building a conditional on the terms of that Taxonomy

I think hence the issue is in a particular difference:
The language, or the way how the language is differentiated (how is it applying its condition)

Please try this to confirm:
- crate the same post in your "default" language - of course, you'd add English (default language) content and leaders, etc, but you can "pretend" to create a default language copy of the faulty Spanish post. This way, we can confirm the same information works when tagged as a default language.
- Then create a new post in the Spanish term, with some very simple data input, something that you know works just fine in English.

If our predictions that the Language terms is somehow faulty is correct, you should be able to see all working in the English post no matter what content it has and wrong data or unexpected output in the Spanish posts.

That then would indicate that we need to focus on how the differentiation between languages is made and how it could affect Toolset Conditions.

#1550235

Ok here's what I did. I created a second CPT called "Chapters - Spanish". I created a post there all in Spanish. I duplicated the original content template for CPT "Chapters" and assigned it to CPT "Chapters - Spanish". Then I went and removed all the conditionals from that template. Now everything is in Spanish only for that "Chapters - Spanish" CPT.

It's all working better now.

Easier to do this than troubleshoot the other.

Thank you!!

#1550477

Yes, this is also a possible approach.

Definitely easier to maintain and less prone to errors.

Please let me know if I can help with anything else?