Skip Navigation

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.

This topic contains 5 replies, has 2 voices.

Last updated by Andreas W. 4 years, 1 month ago.

Assisted by: Andreas W..

Author Posts
October 15, 2020 at 9:57 pm #7240253

miljenkoB-2

Hi, I'm one of many Oxygen users who encounter this kind of problem. For the reference, I have only 1 WPML plugin - Multilingual CMS - installed on my website.

I have set up 1 translation - DE is the default language and EN is an additional language.

I think I did everything alright during the development. Also, I have read this forum before opening a new ticket and I see a lot of users have exactly the same problem:

E.g. 1 - https://wpml.org/forums/topic/oxygen-template-loading-different-content-when-logged-in-and-not-logged-in-users/
E.g. 2 - https://wpml.org/forums/topic/oxygen-builder-wpml-works-fine-only-then-logged-in/

What I did on my website:

1. I have duplicated templates (Main template, Post template, Archive template) with WPML (+ icon) and translated them manually.
2. I did the same with the pages and posts.
3. I've sync the menu.

(I have also signed shortcodes and did similar Oxygen-related "stuff".)

Firstly, I didn't see any problem. Web pages were loading correctly. Switching between 2 languages was smooth and correct.

BUT, when I went in incognito mode (or logged out) and try to navigate the page like any random user, I saw this problem: the page content and the menu were rendering alright, but the rest of the site (header and footer, which depend on the template!) was ALWAYS showing in main language (German in my case).

I found out it could be a problem with the template priority. So, I gave a higher priority to my translated template. This is NOT good at all. Now, a whole website is always using this template. So, I went back to normal priority (0 for all templates).

Now I decided to set up manually a template for EACH post and page. By default, it was set up correctly, but the system is ignoring the default choice when the user isn't logged in. THIS IS OK, IT WORKS! But, it's pain in the ass to do it for every and each post type.

Finally, even if the above solution works on posts and pages where I can manually "hard select" the template (and ignore the default ones), it CAN'T be done on ARCHIVE pages. So, the archives still show only 1 main language for the logged out users.

Have you finally figured out how to solve this incompatibility once and for all?

Thank you
Miljenko

October 18, 2020 at 4:46 am #7250881

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

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

Hello,

Could you please try this option and let us know if it solved the issue?

https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/#:~:text=To%20enable%20language%20information%20for,language%20filtering%20for%20AJAX%20option.

Best regards
Andreas

October 18, 2020 at 12:07 pm #7251823

miljenkoB-2

Hi, thanks for your answer. Interesting solution, but doesn't work.

I have tested on 1 web page. If I chose the DEFAULT template in English to render the page, the visitor will still get the German version of the header and footer. As I have stated before, the content will be OK.

Thus, I had to MANUALLY select the same template in English to make it work. The default ones are ignored.

It's interesting how the menu is always rendering alright. Even the template isn't changed properly, the menu will be translated (WPML sync option). That's cool.

This "manually selecting templates" thing for each page and post is boring, but works. So, that isn't the biggest problem here.

The main problem is that you can't do it THIS WAY (manually) for archives and other pages like the 404 error page. So, it will always show an untranslated version.

I guess it's not that bad for a lot of (static) sites, but if you have a custom post type for e.g. real estate, the index/archive page for items will always be untranslated for logged out users. So, it can be a problem.

I took the time to explain "the whole thing" here, for the reference, and to get proper support. I see a lot of guys have the same issue when using WPML with Oxygen. I really like the WPML experience, but this problem sucks.

I will even post a screen recording (under 2 min) where I show you the following:

1. I didn't choose a template manually, so the site will use the default template to render the web page.
2. As you can see, while I'm logged in, the translation works, and I always get the full translation of a web page.
3. After I log out, the page content and the menu will be translated, but the footer content will still show in German.
4. So, I made a change and manually select the right template to render a web page.
5. After that, the translation will always work, even when I'm logged out.

LINK: hidden link

Can you please make some test from your side and finally get over with this issue? I think you can replicate the problem after my posts here.

Thanks,
Miljenko

October 20, 2020 at 1:35 pm #7266265

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

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

Hello,

I understand the issue now and surely this is not expected behavior.

Now, the Oxygen Plugin is not yet on our plugin compatilbity list and we had barely eight esclated issues about the plugin in the last two years, although our compatilbity team is in contact with the plugin author and we are working on making the plugin compatible with WPML.

For now WPML does not support the translation of Oxygen templates, although it might work translating them with our Translation Editor, there can occur issues.

We instead recommend the following workflow:

https://wpml.org/documentation/plugins-compatibility/oxygen-visual-builder/#translating-oxygen-reusable-elements-templates

But for now, I found the following ticket which reports the same mentioned issue and there is a workaround mentioned for that by applying a specific setting in Oxygen:

https://wpml.org/forums/topic/oxygen-template-loading-different-content-when-logged-in-and-not-logged-in-users/page/2/#post-6693715

Let us know if further assistance is needed.

Best regards
Andreas

October 20, 2020 at 2:29 pm #7266823

miljenkoB-2

Hi, thanks for the response.

Unfortunately, I didn't read anything new clicking on that links. I see you have stated that the Oxygen isn't fully supported and I understand that.

I hope you will find a solution with the Oxygen team.

This shouldn't be a big problem, because Oxygen's templating system could be properly translated for some users - logged in users. So, your compatibility team can focus on that.

In the meanwhile, I'll stay with manually choosing templates on the page edit screen.

BR
Miljenko

October 20, 2020 at 5:17 pm #7268733

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

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

Hello Miljenko,

Indeed, as mentioned our team is actually working on this and other issues and as I reviewed the thread there seems to be no other solution than selecting the templates manually.

Here another workflow that worked out while testing:

1) Create a template and translate it into other languages using CTE or ATE
2) Do not set "Where does this template apply?" in the Template Edit page.
3) Translate the template to all other languages and name them so that you can select each language template individually
4) Make sure every language template is using "Inherit design from" set to the original language
5) Choose the correct language template on each translated page

Can this solve the issue for logged-out users?

If not, please let me know and I will create a test-site for further investigation which I will additional escalate to our compatilbity team in order to obtain a workaround or fix for this issue.

Apart from that, we might need to wait for our team to finalize the Oxygen compatibility testing in order to point out further issues and adjust workflow procedures.

Best regards
Andreas