Multiple domains images in transformation

jason jorgenson asked on March 26, 2019 15:31

Hello Everyone,

kentico 8.2

I am having an issue when it comes to images displayed in a transformation on our store. I am using the "<%# GetAbsoluteUrl(GetSKUImageUrl(265), 1) %>" but it is taking the source of the first domain, not the domain the product is under. this is the link i am receiving "~/getmetafile/02930767-7edc-4a05-aee5-3042615f2f52/Airedale-Terrier_IMG_0172.aspx" not the file path "https://ourdomain.com/getmetafile/02930767-7edc-4a05-aee5-3042615f2f52/Airedale-Terrier_IMG_0172.aspx"

Recent Answers


Brenden Kehren answered on March 26, 2019 18:09

Your statement is confusing, what do you mean by this:

"it is taking the source of the first domain, not the domain the product is under"

0 votesVote for this answer Mark as a Correct answer

jason jorgenson answered on March 26, 2019 18:26

I am currently running two sites under one Kentico installion. The transformation is taking the link of site A not site B when site B is where the image is nested under.

it gives me a link starting with ~/ insted of the link of the domain.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 27, 2019 10:23

Have you tried using this:
<%# GetFileUrl("ImageField") %/>

This will return relative path of the image in given field. So, you will need toadd just the domain name and compose the IMG tag source parameter like http://domainoftheothersite.com + <%# GetFileUrl("ImageField") %>:

<img src="http://domainoftheothersite.com/<%# GetFileUrl("ImageField") %>" />

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 27, 2019 18:11

Jason,

How do you have your sites configured in the Sites app? Do you have the actual domain you're using in the domain box or are you using some alias? What will be returned with the GetAbsoluteUrl() function is the value that's in the Site domain name box.

site domain screenshot

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.