Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 -
- 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Nigel 7 months, 2 weeks ago.

Assisted by: Nigel.

Author Posts
October 10, 2023 at 1:52 pm #14550781

bastianv-2

I am trying to: Create a new template / change template content for English (second language, first is German).

Link to a page where the issue can be seen: See attached screenshot

I expected to see: Successfully saving the template

Instead, I got: "Saving failed." on page save.

This issue occurs only when WPML is active. If deactivated, there is no issue.

However, this error only occurs if you select "English" in the WP admin menu and then go into the site editor. Neither creating a new nor changing existing templates is working here. The error is always "Saving failed." If language is German and we try the same, it works just fine.

hias-template.png
October 10, 2023 at 2:10 pm #14551099

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Hi there

Your default language is DE, correct? And you can edit and update templates in German without any problems, but trying to edit/update templates in English is not working, yes?

Your intention is not to use the translation editors to translate the template from DE to EN, and instead to use the normal WordPress editor, switch between languages, yes?

The templates are a feature of your theme? It looks like you are using a custom theme.

Would it be possible to get a copy of the theme (you can zip up the theme files and share a link to dropbox, wetransfer or similar here, the links are automatically hidden).

What kind of template were you editing when having this problem? (Or does it not matter?)

October 10, 2023 at 2:34 pm #14551499

bastianv-2

Hi there and thank you for your quick reply!

"Your default language is DE, correct? And you can edit and update templates in German without any problems, but trying to edit/update templates in English is not working, yes?"

That's correct.

"Your intention is not to use the translation editors to translate the template from DE to EN, and instead to use the normal WordPress editor, switch between languages, yes?"

Also correct, we manually translate each page via WP editor.

"The templates are a feature of your theme? It looks like you are using a custom theme.

Would it be possible to get a copy of the theme (you can zip up the theme files and share a link to dropbox, wetransfer or similar here, the links are automatically hidden)."

Yes, we are using a custom theme. However, when switching to a standard WP theme, the error still persists. In this regard I don't think it is necessary to share the theme.

"What kind of template were you editing when having this problem? (Or does it not matter?)"

Our goal is to have a "standard" template for english pages. At the moment, we can not create a template in the site editor which is then available to select when editing an english page. From our understanding, the only way to have that template available when editing an english page is by creating it in the site editor after selecting english in the admin menu.

October 10, 2023 at 3:25 pm #14551831

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Understood.

I tested on my local test site with twentytwentythree theme and can reproduce the problem.

I searched and found an internal ticket about this, we have had two reports of some variation of this in the past. I'm adding this thread to that ticket, which should help bump the priority.

Note that this only occurs when WordPress is installed in a sub-directory (which is the case on my local site and appears to be with your site).

Unfortunately I don't have a workaround for you.

Do note, though, that you can translate the template (as described in our documentation here: https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/).

But if you want a different layout on different languages (rather than just translating texts that appear in the template) that's currently not possible.

I'll let you know when there are any updates from the developers relating to this.

October 11, 2023 at 12:48 pm #14559579

bastianv-2

Thank you for your reply and the additional information regarding this issue.

In the meantime, we might be able to work around the issue by using the approach posted here: https://wpml.org/forums/topic/different-page-template-for-different-language-page/

By using QuickEdit instead of opening the full page to change the template, we can also see and select the German templates. This should work for us.

Thank you for your help and please keep us updated about a possible solution.

October 11, 2023 at 1:58 pm #14559975

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

OK, good luck with that, I wasn't able to get it working on my test site, but hopefully you can.

I'll update here when we have some plugin updates to fix the underlying problem.

October 12, 2023 at 8:02 am #14563499

bastianv-2

Actually you are right, it does also not work over 'Quick Edit'. You say that the issue only appears to occur when WP is installed in sub-directoy. Can you confirm that it works when it is in the root. For us it is hightly important that we can use specific templates for the secondary language. Hopefully it can be fixed soon. Please keep us updated. Thanks!

October 12, 2023 at 8:57 am #14564035

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

The previous reports specifically state it is a problem with WordPress in a sub-folder.

I created a sandbox site to test where it is in the root, which you can log into with this link: hidden link

Default language EN, second language ES.

Check the only Post on the site in both languages, and you'll see that the ES post is using a distinct template I created.

Feel free to play around with the site to test and confirm it works.

December 12, 2024 at 12:08 pm #16507621

bastianv-2

Hi there, after one year I am wondering whether this problem is still not resolved and why it is still not possible to have different templates or template parts when the site is in a sub-directory? Thanks for any feedback.

December 12, 2024 at 1:48 pm #16508075

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Hi there

I reviewed the internal tickets and you are correct to note that it is not resolved.

You are probably aware that there is a major upgrade of WPML in the works (version 4.7, of which a beta is available), which has been the principal focus of the development team for much of this year. This reported problem is open and scheduled to be looked at after the production release of 4.7.

In the meantime, I reconfirm that the problem only happens when WordPress is installed in a sub-directory, and note from the other reports that, in that case, it can be avoided if the settings are to add the language via a url parameter.

When I see progress in the internal ticket I will share it with you.

I'm sorry it hasn't been possible to resolve the problem already.