Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > Image file isn't displayed after linking a document View modes: 
User avatar
Member
Member
yuriy.chabanov-gmail - 2/13/2014 4:47:32 AM
   
Image file isn't displayed after linking a document
Hello,
here is the scenario I went throuht to face the issue:
1) Created a custom document.
2) Added an image into one the fields of the document(regular File-type field).
3) Added a transformation to show the image.
-->so far so good, the document is showing fine!
4) Linked the document on another site
-> The image isn't displayed when I open the doc on the new site but does when I do on the original site..
Has anyone met this behaviour before?
Thanks.

User avatar
Member
Member
yuriy.chabanov-gmail - 2/13/2014 7:28:19 AM
   
RE:Image file isn't displayed after linking a document
I think I was able to found reasonable explanation. The content table of the document references the image's GUID.
On original site the transformation Eval("Photo") results in:
http://site1/GetFile?Guid='aaa'
After linking the document on another site the transformation produces:
http://site2/GetFile?Guid='aaa'
Obviousbly it cannot find the image with this GUID on the second site..Copying and linking the images doesn't work because both create records with new GUID values.

However I found a possible workaround. When I observ the 'Form' of the document "/getattachment/" is used instead of "/GetFile" and ... I can see the image! Actually "getattachment" also passes site name, this is why it works this way. Having this I think it's possible to use another function in transformation to use "getattachment" instead. Is there any other functions besides Eval to show the image?
Thanks.

User avatar
Member
Member
yuriy.chabanov-gmail - 2/13/2014 7:34:37 AM
   
RE:Image file isn't displayed after linking a document
Sorry for the typo above, I'm using GetFileUrl("Photo"), not Eval("Photo"). I need some sort of function to specify original site or any other advice would be helpful.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 2/15/2014 2:32:07 PM
   
RE:Image file isn't displayed after linking a document
Hello,

The behavior you are requesting is not possible with the Eval functions because the function is evaluated according to the current site content.

So as you have already found a workaround, I would recommend you to use that approach.

Best Regards,
Martin Danko