WPML

Overview of the Issue

When using GreenShift 13.2.1 or later with WPML, you might experience the following issue: on a translated page, the GreenShift Heading, Advanced text and Button blocks show “This block contains unexpected or invalid content” in the block editor. The translated page shows the right texts on the front end. If you fix the blocks in the block editor, they get the text of the default language back.

Workaround

Go to WPMLSettingsCustom XML Configuration, add the following code and save. Then update the translation of each page that uses these blocks.

XML
<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="greenshift-blocks/heading" translate="1" label="Advanced heading">
      <xpath>//*[contains(@class, 'gspb_heading')]</xpath>
      <key name="headingContent" />
      <key name="title" />
      <key name="text" />
      <key name="textbefore" />
      <key name="textafter" />
      <key name="customAnchor" />
      <key name="subTitle" />
      <key name="animatedText"><key name="*" /></key>
      <key name="dynamictext"><key name="dynamicField" /></key>
    </gutenberg-block>
    <gutenberg-block type="greenshift-blocks/text" translate="1" label="Advanced text">
      <xpath>//*[contains(@class, 'gspb_text')]</xpath>
      <key name="textContent" />
      <key name="text" />
      <key name="customAnchor" />
      <key name="dynamictext"><key name="dynamicField" /></key>
    </gutenberg-block>
    <gutenberg-block type="greenshift-blocks/button" translate="1" label="Advanced Button">
      <xpath>//*[contains(@class, 'gspb_button_wrapper')]</xpath>
      <key name="buttonContent" />
      <key name="label" />
      <key name="buttonLink" />
      <key name="customAnchor" />
      <key name="closeLabel" />
      <key name="openLabel" />
    </gutenberg-block>
    <gutenberg-block type="greenshift-blocks/buttonbox" translate="1" label="Advanced Button">
      <xpath>//*[contains(@class, 'gspb_button_wrapper')]</xpath>
      <key name="buttonContent" />
      <key name="label" />
      <key name="buttonLink" />
      <key name="customAnchor" />
      <key name="closeLabel" />
      <key name="openLabel" />
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

All known issues

Need Help with This Issue?

Ask a support question and we’ll look into it with you.