סקירת התקלה
בעת שימוש ב־GreenShift 13.2.1 או בגרסאות חדשות יותר עם WPML, ייתכן שתיתקל בבעיה הבאה: בעמוד מתורגם, הבלוקים Heading, Advanced text ו־Button של GreenShift מציגים את ההודעה “This block contains unexpected or invalid content” בעורך הבלוקים. העמוד המתורגם מציג את הטקסטים הנכונים בצד הלקוח. אם תתקן את הבלוקים בעורך הבלוקים, הם יקבלו בחזרה את הטקסט של שפת ברירת המחדל.
פתרון עוקף
עבור אל WPMLהגדרותהגדרות XML מותאמות אישית, הוסף את הקוד הבא ושמור. לאחר מכן עדכן את התרגום של כל עמוד שמשתמש בבלוקים האלה.
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>