Panoramica del problema
Quando usi GreenShift 13.2.1 o versioni successive con WPML, potresti riscontrare il seguente problema: in una pagina tradotta, i blocchi Heading, Advanced text e Button di GreenShift mostrano il messaggio “Questo blocco contiene contenuti inaspettati o non validi” nell’editor a blocchi. La pagina tradotta mostra i testi corretti sul front-end. Se correggi i blocchi nell’editor a blocchi, torneranno a mostrare il testo della lingua predefinita.
Soluzione alternativa
Vai a WPMLImpostazioniConfigurazione XML personalizzata, aggiungi il seguente codice e salva. Quindi aggiorna la traduzione di ogni pagina che utilizza questi blocchi.
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>