Skip Navigation

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 1 reply, has 2 voices.

Last updated by Dražen 4 years, 10 months ago.

Assisted by: Dražen.

Author Posts
February 7, 2020 at 12:18 am #5443007

reedM

Hello,

I had a chat yesterday with one of your supporters - Itamar - and this message is a follow-up to that conversation.

My problem is that I cannot translate the links behind Single Images on this site - textile-du-maine.com. Itamar asked me to the following to fix the problem:

1. Go to WPML -> Settings -> Custom XML Configuration (tab)
2. Insert this code.

<wpml-config>
<shortcodes>
<shortcode>
<tag>vc_single_image</tag>
<attributes>
<attribute encoding=\"allow_html_tags\">title</attribute>
<attribute type=\"media-ids\">image</attribute>
<attribute>link</attribute>
</attributes>
</shortcode>
</shortcodes>
</wpml-config>

3. Save the canges.
4. Go to the editing screen of the page where the image is.
5. Change something in the page (a smal change so you\'ll be able to updated the page.
6. Go to the translation and now you will see a field with the link nd you\'ll be able to translate it.
7. Finish the translation and check if it works.

Unfortunately, when I entered in the code above into the Custom XML Configuration tab, and hit Save, I get this error message:
The XML is not valid:
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag attribute line 6
Opening and ending tag mismatch: attributes line 5 and attribute
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag attribute line 7
Opening and ending tag mismatch: shortcode line 3 and attribute
Opening and ending tag mismatch: shortcodes line 2 and attributes
Opening and ending tag mismatch: wpml-config line 1 and shortcode
Extra content at the end of the document

What should I do?

Best regards,

Reed

February 7, 2020 at 3:41 pm #5448953

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello!

Welcome to WPML Support.

I'll do my best to help you solve this issue.

I have checked the provided XML configuration code, character "/" is not needed here. When you try validating code without it, code is valid and saved.

Try saving next Custom XML Configuration (WPML -> Settings -> Custom XML Configuration (tab)):

<wpml-config>
    <shortcodes>
        <shortcode>
            <tag>vc_single_image</tag>
            <attributes>
                <attribute encoding="allow_html_tags">title</attribute>
                <attribute type="media-ids">image</attribute>
                <attribute>link</attribute>
            </attributes>
        </shortcode>
    </shortcodes>
</wpml-config>

Then please follow Itamar suggested steps:

- Go to the editing screen of the page where the image is.
- Change something in the page (a small change so you\'ll be able to update the page.
- Go to the translation and now you will see a field with the link and you\'ll be able to translate it.
- Finish the translation and check if it works.

Let me know how it goes and don't hesitate to ask if you find any problem along the way or have doubts or questions about the steps mentioned above, I'll do my best to help you in the best way possible."

Regards,
Drazen