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

Last updated by Jesse 5 years, 4 months ago.

Assigned support staff: Harshad.

Author Posts
January 26, 2014 at 1:32 pm #327786

Jesse

Hello.
When I use Pagelines DMS to upload a image to a section in the secondary language site, the url has the language code (like '/en/') in it, so the image won't show.
WPML changes the home ([pl_site_url]) from yoursite.com ---> yoursite.com/en

So

[pl_site_url]/wp-content/uploads/2014/01/favorite.jpg

ends up being:

 <im src="<em><u>hidden link</u></em>">

And the image does not exist there. It should be:

<im src="<em><u>hidden link</u></em>">

What is the logic in WPML, when does it show the home as the home and when as the home of this current language? How to fix this?
Do you have plans on working together with Pagelines if necessary?

Thank you!

January 26, 2014 at 3:16 pm #327825

Harshad

Dear Jesse,

WPML converts the site_url, according to the active language, So it suffix the language code to site url.

I think you can strip out [pl_site_url] from [pl_site_url]/wp-content/uploads/2014/01/favorite.jpg and use absolute path.

February 10, 2014 at 11:27 am #336510

rolandF

A better way is this:

replace the "[pl_site_url]/" for "../"

February 18, 2014 at 9:03 am #342090

Jesse

Thanks rolandF.

Can you briefly explain why that works? Is it for child-pages so it goes one folder up to the root and won't try to load from for example example.com/childpage/wp-content/uploads but goes to example.com/wp-content/uploads ?

Then why do both
"../"
and
"/"
work on the homepage?

Thanks!

February 18, 2014 at 12:21 pm #342300

Harshad

Dear Jesse,

Like I said in my previous reply, WPML converts the site_url, according to the active language, So it suffix the language code to site url.

So instead you can use absolute URL starting with "/", So it will prefix the site_url when image is attached.

March 5, 2014 at 11:08 am #352501

Jesse

nice