soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 31 forks source link

Support for WPML plugin #938

Open raykai opened 4 years ago

raykai commented 4 years ago

Describe the feature you'd like to see included in Oxygen. Support for WPML https://wpml.org plugin would be good to have for Oxygen

What are the use cases for this feature? Language Accessibility

Examples of this feature or functionality. It would allow users to use more than one language on their sites when they build using Oxygen. I live in a country where we need two languages on our sites so having support for WPML is almost a must for us.

KarzanTT commented 4 years ago

+1 Support Oxygen for WPML plugin!

Xilonz commented 4 years ago

I've used WPML on an Oxygen site and it works pretty well, I'd say it's usable. If you rely on translators directly translating in WPML, Oxygen won't work for you.

What works:

What doesn't work

Buggy behavior:

Tip:

Use Oxygen Gutenberg blocks, they can easily be cloned to the other language and edited. Giving you enough power to barely need to translate templates or navigate to the Oxygen builder.

Xilonz commented 4 years ago

WPML Oxygen CSS Caching support for duplicated pages as there's never a css cache generated for duplicated posts. Oxygen should block the builder from being used on duplicated pages when WPML support ships.

cache.php:297

      ... 
    // finally enqueue styles
    foreach ($oxygen_vsb_css_files_to_load as $post_id) {

+               $post_id = apply_filters( 'wpml_master_post_from_duplicate', $post_id ) ?: $post_id;

        if ( isset($files_meta[$post_id]) && isset($files_meta[$post_id]['success']) ) {

            // cache file is present for this post

            $url = $files_meta[$post_id]['url'];
            $url = add_query_arg("cache", $files_meta[$post_id]['last_save_time'], $url);
            $oxygen_vsb_css_styles->add("oxygen-cache-".$post_id,  $url);
            $oxygen_vsb_css_styles->enqueue(array("oxygen-cache-".$post_id));

        }
        ... 
Xilonz commented 4 years ago

In order to see translated templates when not logged in, modify /component-framework/admin/cpt-template.php. Please note that this will make the templates publicly_queryable.

...
function ct_add_templates_cpt() {

-   if(!oxygen_vsb_current_user_can_access()) {
-       return;
-   }

    $labels = array(
        'name'               => _x( 'Templates', 'post type general name', 'component-theme' ),
        'singular_name'      => _x( 'Template', 'post type singular name', 'component-theme' ),
        'menu_name'          => _x( 'Templates', 'admin menu', 'component-theme' ),
        'name_admin_bar'     => _x( 'Template', 'add new on admin bar', 'component-theme' ),
        'add_new'            => _x( 'Add New Template', 'template', 'component-theme' ),
        'add_new_item'       => __( 'Add New Template', 'component-theme' ),
        'new_item'           => __( 'New Template', 'component-theme' ),
        'edit_item'          => __( 'Edit Template', 'component-theme' ),
        'view_item'          => __( 'View Template', 'component-theme' ),
        'all_items'          => __( 'Templates', 'component-theme' ),
        'search_items'       => __( 'Search Templates', 'component-theme' ),
        'parent_item_colon'  => __( 'Parent Templates:', 'component-theme' ),
        'not_found'          => __( 'No templates found.', 'component-theme' ),
        'not_found_in_trash' => __( 'No templates found in Trash.', 'component-theme' )
    );
       ...
Contributolo commented 4 years ago

Please make oxygen wpml compatible. Multilingual is so important...

out-of-order commented 3 years ago

very important!

KarzanTT commented 3 years ago

UpVote, Very important to make oxygen works with WPML plugin.

out-of-order commented 3 years ago

It is a fundamental connection between one of the best construction kits and the IMHO best maintained Multilanguage building block.

out-of-order commented 3 years ago

can anyone help with the second language search page results template to pick up the duplicated main template? If I set the priority, then it also picked up in the first language.

Nearly nothings works. I had to duplicate all pages page per page. The management tool sucked totally. Some text fragments are displayed in the translation tool, but not displayed in the frontend.

It sucks!. It is absolutely the worst and most imaginable trashy peace of crappy software. The only thing which works is the Duplicate Page Plugin which the WPML guys have not developed.

But what option is better? I just hate to work with it in the combination with oxygenbuilder. But I have to make the page multilang.

Contributolo commented 3 years ago

Don't use oxygen with wpml for client or important production sites. I think it is the only option at the moment. If you now find a hacky solution it is not save for the future... I would not use it at the moment.

out-of-order commented 3 years ago

But I need a way to make it multilang!

out-of-order commented 3 years ago

Thanks to Kevin from Oxygen I was able to solve my task. To translate a page:

Pages

Posts (Gutenberg)

That's easy. I have some mixed Gutenberg/Oxygen Posts You can directly translate Gutenberg Posts with WPML. I have used the classic tool. The new sucks IMHO.

Posts (Oxygen)

Do so like you would do with Pages

Don't use the duplicate plugin to copy templates as WPML proposes. Again here the adverts of WPML are wrong. That doesn't work at all. Only main and Pages do work this way. But what with 404, Posts, Search etc...?

Templates

I lost so much time with it. Here you go how to deal with the template task:

To get elements like fake breadcrumbs or footer elements (and all other individual stuff that brings you freedom to do as you want to) use conditions:

  1. install the Code Snippet. This snippet checks for a language string within the URL when the function check_language_url is called. For example, /en/ or /fr/, and then returns a string for the language. In the future, you may add additional languages as you wish.

`<?php

/**

}`

  1. you may go into any one of your Oxygen templates and copy any elements you wish to translate and translate them within the editor

  2. Finally, to set up the condition settings:

    Select an element that you would like to show for a language Click the Condition Settings icon Click Set Conditions > Dynamic Data > PHP Function Return Value Enter "check_language_url" into the Function Name (without quotes) Enter the return value of the language you would like to display it for. You will need to set this up for all elements you would like to hide or show based on a language barrier.

That's it! I really can't find the words how I dislike to work with WPML but the job is done. Horrible usability with all pages manually duplicated and edited but it's possible.

marcdegagne commented 3 years ago

Voting for full compatibility ASAP with WPML.

I am from the DIVI ( Bloated) world and am looking forward to have a good page builder like Oxygen compatible with WPML.

For does looking for some help on the subject:

<wpml-config> <shortcodes> <shortcode> <tag>oxy_rich_text</tag> </shortcode> <shortcode> <tag>ct_link_text</tag> </shortcode> <shortcode> <tag>ct_link_button</tag> </shortcode> </shortcodes> </wpml-config>

IF any body knows how to get the link to translation in any modules with links that would help! Maybe a attribute tag?

Thanks!

albertvisuals commented 3 years ago

+1 for WPML support! Really needed!!!

raykai commented 3 years ago

+1 for WPML support!

V0IDNIL commented 3 years ago

+1 for WPML support please!

Nemesis19 commented 3 years ago

+1

danpii commented 3 years ago

+1

octapress commented 3 years ago

+1

JonathanF88 commented 2 years ago

+1 for WPML. If you are serious enough, we need WPML support! Templates would be a nice starting point.

kartzke commented 2 years ago

+1 for WPML support!

angang commented 2 years ago

Native support without tricks is vert very important.

ranx2k commented 2 years ago

+1

Schokolader commented 2 years ago

+1

knut-studio commented 2 years ago

+1

Jehu commented 2 years ago

We really need a solution so we can use WPML's translation Editor instead of using manual translation as a workaround mentioned on https://wpml.org/errata/oxygen-builder-widget-and-link-translation-issues/

Can't get https://wpml.org/forums/topic/oxygen-builder-translation/#post-8600795 to work, but this can't be impossible to solve for the Oxygen/WPML devs.

strategio commented 2 years ago

+1

ofwald commented 2 years ago

+1

dgwatkins commented 2 years ago

+1 for WPML support!

frucci99 commented 2 years ago

+1 for WPML support!

Provision1080 commented 2 years ago

+1! Support Oxygen for WPML plugin!!

etcaetera commented 2 years ago

+1! that's for sure

parodev commented 2 years ago

Yes, please +1

kurosato commented 2 years ago

+1, please

montrealist commented 2 years ago

Yess, WPML support for the win!

SinjoriS commented 2 years ago

+1 for fully WPML support!

szymonsd commented 2 years ago

+1 for WPML support!

adrien-robert commented 2 years ago

+1

Uxksu commented 2 years ago

🆙Vote, Very important to make oxygen works with WPML plugin.

SinjoriS commented 2 years ago

+1 for WPML support! We are in 2022 - and no WPML fully support. That's a bad joke!

madjedo commented 2 years ago

An interesting behavior/bug:

Try this on a staging site, on a translated page:

Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language.

Does the translated version of the page revert back all its content to the default language?

SinjoriS commented 2 years ago

An interesting behavior/bug: Try this on a staging site, on a translated page: Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language. Does the translated version of the page revert back all its content to the default language?

Yes, that's tue. I can confirm also on my side. Just tested on one of my Site, and bug appears.

Jehu commented 2 years ago

@madjedo interesting! We had the revert bug on some pages in a big project and could find the reason nor replicate it. But your finding is a valuable hint.

SinjoriS commented 2 years ago

An interesting behavior/bug: Try this on a staging site, on a translated page: Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language. Does the translated version of the page revert back all its content to the default language?

In fact, that bug happens when you change styling by Oxygen (font size, or color on text), on default language - on the page. When you hit Save button after that - translation is lost on the page with additional language. The same bug appears when you change for instance the link on the button - on default language page.

Jehu commented 2 years ago

@SinjoriS thats horrible!

d-packs commented 2 years ago

+1 WPML support is buggy. I'm at a loss here. For some odd reason the translated template for Single product is correctly picked up only when logged in. When not logged in the default language of the template is always used, even if the content itself is translated (meaning the language is correctly detected). This is a quote from the WPML forums and it shows a major flaw in the coding of Oxygen builder. Instead of relying on standard WordPress mechanisms for hiding the templates from users, it uses some self-baked method, which in turn makes law-abiding plugins unable to properly interact with Oxygen's 'ct_template' objects. I'm sure there is a legit reason for this choice, but obviously it was not a good choice.

Hi,

I am Sumit from 2nd tier support.

The problem is in the Oxygen builder and we are in contact to fix this issue. However, if you pass the info the oxygen support this will help to speed up the process.

Problem ct_template post type registered only for logged-in users in \oxygen\component-framework\admin\cpt-templates.php so when non-logged-in users visit the site WPML does not filter the posts from unregistered post type and first template (from any language) is displayed for all posts.

Oxygen builder should use post capability argument instead of registering the CPT only for logged-in users. Ref hidden link

Workaround Meanwhile, you can use the workaround to make this work with WPML.

1 Manually Edit the translated post

2 Select the correct translated template from the Oxygen widget, not the Default option.

3 Update the post and check on the front-end. Please do this for all translated posts.

Thanks Their workaround does not work for any custom post type that is not using Oxygen for design. Nor does it work on 404, search etc.

madjedo commented 2 years ago

@d-packs That workaround is how I translate my products, it works ok except a few quirks.

But interesting he mentions they are in contact with Oxygen team for this. @Spellhammer Are you perhaps in stealth working on a official integration? I know your policy is not too reveal any future work, but this one is important for a lot of businesses and their future direction on using Oxygen builder and WPML, especially for e-commerce sites.

steverevere commented 2 years ago

+1. Need this one big time.

Thanks!

SinjoriS commented 2 years ago

An interesting behavior/bug:

Try this on a staging site, on a translated page:

Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language.

Does the translated version of the page revert back all its content to the default language?

Regarding this bug, here it is solution (answer) from WPML official support. They asked Oxygen support to check that. I hope somebody from Oxygen team will see this. I also sent them a ticked on their Site.

Open this file: wp-content\plugins\oxygen\component-framework\includes\wpml-support.php around the line 19 you will see the code:


add_filter( 'wpml_pb_shortcodes_save_translation', 'ct_wpml_filter_save_translation', 10, 3 ); function ct_wpml_filter_save_translation( $saved, $translated_post_id, $new_content ) { update_post_meta( $translated_post_id, "ct_builder_shortcodes", $new_content ); return true; }


Please, comment this line of code: //add_filter( 'wpml_pb_shortcodes_save_translation', 'ct_wpml_filter_save_translation', 10, 3 );

675056817 commented 2 years ago

+1