Skip Navigation

[Resolved] Strange behavior of Toolset content templates with WPML

This support ticket is created 3 years, 2 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by caroleM-4 3 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#2182657
toolset-ct-5.jpg
toolset-ct-4.jpg
toolset-ct-3.jpg
toolset-ct-2.jpg
toolset-ct-1.jpg

Hello,

I am actually fighting with content templates translations using WPML for custom post types for which I need a different template for secondary language and noticed a few strange things I would like to be able to understand :

- When creating a new content template, I can choose between default and secondary language for it as for pages but there is no language switcher on the dedicated backend page which means the templates created in secondary language can not be edited anymore even though they seem to be existing (attached screenshot 1)

- If I edit a default language content template and change its language it disappear from the list for the same reason and thus become unreachable.

- When editing a default language content template there is a "Connect with translations" link (attached screenshot 2) which suggest there could be some (which is the case for me) but the link is not working, once again probably for the same reason, meaning I can't even reach them that way.

- If I add a translation to a default language content template using the "+" button (attached screenshot 3) I have no way to edit it once saved except for the string via WPML translation editor and neither can I delete it to add a new translation as I can not reach it .

- If I make some style changes on a Gutenberg block of the default language template, as for exemple adding a background and changing font size, the translated block gets messed up (attached screenshots 4 and 5) and the only way to get it fixed is to remove it and add it again as I can't edit the translation directly and have no grip on styles through translation editor.

- If I need to have different blocks on a template for the default language and the secondary language, which is my case for some of the CPT, I can't for the same reasons.

Content templates appear in WPML settings as "Translatable - use translation if available or fallback to default language" so I think the translated version should be reachable, editable and removable as it's the case for other content types which have the same settings but it's not the case actually and it's getting me in big troubles.

Could you please help me understand what's the correct way of doing to avoid those problems ?

Thanks in advance for your help.

#2182895

Shane
Supporter

Languages: English (English )

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

Hi Carole,

Thank you for getting in touch.

In order for me to have a better understanding of what is happening here I will need to have a look at the site through the backend.

Would you mind allowing me to have admin access to the site as well as a link to a page where I can clearly see the issue with the content template translation.

Thanks,
Shane

#2184983

Shane
Supporter

Languages: English (English )

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

Hi Carole,

Thank you for the clone as well as the detailed response.

I had a look at the issue you're having and it appears that what you're expecting is to essentially be able to create a new content template for your french posts.

Based on our documentation it doesn't appear that this is possible to do.
https://toolset.com/course-lesson/translating-views-content-templates-archives-and-forms/

The above documentation illustrates the correct way to translate the content templates as the methods have changed since the the recent updates in WPML with the new Advanced Translation Editor.

You'll also need the WPML Translation module setup for this to work.

Can you test the methods in the documentation and let me know if there are any improvements in your experience.

Thanks,
Shane

#2186089
toolset-ct1.jpg

Thanks for the feedback and sorry to have missed some parts of WPML setup on the example website.

I finished the translation management setup but the problem also occurs from there :
- If I try to send to translation a content template which contains a view block, for exemple "Content template 7", the operation never complete (attached screenshot) meaning I can not translate it.
- If I go to "WPML > Translations" and try to edit existing translation of "Content template 3" on which I added a view block after it was translated, I get a critical error.

There really seems to be a problem with the translation of content templates on which a view block has been added and that's very annoying for me for the following reasons :
- I need view blocks on single templates of some of my custom post types and really would like to build them with Toolset
- I was advised to wrap view blocks used inside pages in content templates as a workaround to the issue described on https://toolset.com/forums/topic/pages-custom-fields-updated-for-all-pages-containing-same-view-block/
- I cannot used WPML string shortcodes as a workaround as they actually do not work for parametric filter placeholders and are meant to be removed on future versions as mentioned on https://toolset.com/forums/topic/using-wpml-shortcodes-as-dropdown-placeholders-break-search-filters/

So could you please try to translate "Content template 7" on the exemple website to see if you encounter the same problem ?

And also please tell me if there is a way to have different blocks on default and secondary language content templates because it's also something I will need to find a solution for if I cannot edit secondary language content template individually as I can do with pages.

Thanks in advance for your help.

#2189799

Well, I ran a few more tests but this time using the advanced translation editor which allowed me to discover that most of the problems I was previously encountering when trying to translate content templates including view blocks were in fact due to a WPML string shortcode I missed when removing them to see if the issue was related to their presence.

So the main issue is solved and I should now be able to deal with the blocks I need to show only in one language using conditional display with a custom function.

Thanks a lot for your patience and have a nice day.