Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
When using WPML with Elementor, after translating a page to secondary languages, any new text added in the original language and updated in translation causes previously saved button links to revert to the original.
Solution:
To fix this issue, you need to register custom page builder widgets for translation of the Hub theme by Liquid Themes. This involves adjusting the

wpml-config.xml

file in your theme to include the links in the translation process. Here is a step-by-step guide:
1. Check if your Hub theme's by Liquid Themes

wpml-config.xml

file already includes widget translation configurations.
2. Modify the XML configuration to add the button links for translation. For example, add the following field to your button widget configuration:

<field type="Heading: Link URL" editor_type="LINK">link>url</field>

3. For detailed instructions, refer to our documentation on how to register page builder widgets for translation: https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket at our support forum.

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 19 replies, has 3 voices.

Last updated by Andrey 1 month, 1 week ago.

Assisted by: Andrey.

Author Posts
September 26, 2024 at 7:56 am #16223391

gianlucaP-16

Hi Andrey

Thank you for checking. Unfortunately that does not work for us, as its not only the Liquid button but also other Liquid elements, for example as seen in this page hidden link

Is there any way to maybe register those kind of elements and make them translatable?

September 26, 2024 at 11:37 am #16224779

Andrey
Supporter

Languages: English (English ) Russian (Русский )

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

Yes, it is possible. We have documentation on how to register custom page builder widgets for translation.

You need to follow this article:
https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

I noticed that your parent theme already has a wpml-config.xml file. The code registers those themes' widgets for translation. You or the theme author need to adjust the code to add the links to the translation.

For example, I have found the following code for the button:

		<widget name="ld_button">
			<conditions>
				<condition key="widgetType">ld_button</condition>
			</conditions>
			<fields>
				<field type="Liquid Button Text" editor_type="LINE">title</field>
			</fields>
		</widget>

You have to add an additional field that adds the button link to the translation. Here's an example from the article above:

<field type="Heading: Link URL" editor_type="LINK">link>url</field> 

I hope this helps.

September 26, 2024 at 11:51 am #16224809

Andrey
Supporter

Languages: English (English ) Russian (Русский )

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

I went ahead and used the Multilingual Tools plugin to generate an XML config for a few custom Elementor widgets (Liquid button and Liquid content Box from the last page you mentioned).

What have I done?

1. Installed Multilingual Tools plugin on your test site.
2. Followed this article: https://wpml.org/documentation/support/multilingual-tools/registering-custom-elementor-widgets-for-translation/#using-wpml-config-generator-for-elementor
3. Took already existing content for those widgets from a wpml-config.xml file of your theme. Which looks like:

    <widget name="ld_button">
      <conditions>
        <condition key="widgetType">ld_button</condition>
      </conditions>
      <fields>
        <field type="Liquid Button Text" editor_type="LINE">title</field>
      </fields>
    </widget>
    <widget name="ld_content_box">
      <conditions>
        <condition key="widgetType">ld_content_box</condition>
      </conditions>
      <fields>
        <field type="Liquid Box: Title" editor_type="LINE">title</field>
        <field type="Liquid Box: Subtitle" editor_type="LINE">subtitle</field>
        <field type="Liquid Box: Label" editor_type="LINE">label</field>
        <field type="Liquid Box: Content" editor_type="LINE">content2</field>
      </fields>
    </widget> 

4. Checked the code generated in Step 2 for widgets and took only the fields for the button link.

<field type="Liquid Button Link" editor_type="LINK">link>url</field>

and

        <field type="Liquid Box: Button Link" editor_type="LINK">ib_link>url</field>
        <field type="Liquid Box: Image Link" editor_type="LINK">img_link>url</field>

5. Added to the existing code and further added the new config for two widgets to WPML → Settings → Custom XML Configuration.

<wpml-config>
  <elementor-widgets>
    <widget name="ld_button">
      <conditions>
        <condition key="widgetType">ld_button</condition>
      </conditions>
      <fields>
        <field type="Liquid Button Text" editor_type="LINE">title</field>
        <field type="Liquid Button Link" editor_type="LINK">link>url</field>
      </fields>
    </widget>
    <widget name="ld_content_box">
      <conditions>
        <condition key="widgetType">ld_content_box</condition>
      </conditions>
      <fields>
        <field type="Liquid Box: Title" editor_type="LINE">title</field>
        <field type="Liquid Box: Subtitle" editor_type="LINE">subtitle</field>
        <field type="Liquid Box: Label" editor_type="LINE">label</field>
        <field type="Liquid Box: Content" editor_type="LINE">content2</field>
        <field type="Liquid Box: Button Link" editor_type="LINK">ib_link>url</field>
        <field type="Liquid Box: Image Link" editor_type="LINK">img_link>url</field>
      </fields>
    </widget>
  </elementor-widgets>
</wpml-config>

6. Updated the original pages with the links (Räume and FAQ). I completed the translations, and the links are now converted.

If there are some more widgets, you need to handle them on your own.

Screenshot 2024-09-26 at 14.49.33.png
Screenshot 2024-09-26 at 14.49.07.png
September 26, 2024 at 1:59 pm #16225696

gianlucaP-16

Hi Andrey

Thank you for your work. So that means, I should now be able to see these kind of buttons in the advanced translator, right? Because currently, I do not see where I can translate the link.

s1.png
September 26, 2024 at 2:12 pm #16225788

Andrey
Supporter

Languages: English (English ) Russian (Русский )

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

No, it should be converted automatically when you complete the translation and if a link translation exists. This is because I indicated editor_type="LINK" in the config.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.