+ Start a Discussion
kkhuranakkhurana 

Referring images stored in Salesforce database on Site.com sites.

Hello,

 

I have managed to display images on Site.com sites keeping the source of the images as Salesforce.com. I am passing the URL of the image stored in  Salesforce.com to the text field or rich text area and can very well fetch the same with the help of repeater element in Site.com.  But, when I try to fetch the image from a formula field on my SFDC object, the image do not show up and I only see the URL. Please refer this URL for more clarity:

 

https://sitepreview.ap1.force.com/?previewAuth=13rFMpCAjZgek51aapihocyN1p2v85cevGjwDZt2RR6ey2UksudNKpt4zf7iqk_8gSxjW_w%3D%3DA

 

I must be missing something, please suggest what it is. :)

 

Any pointers are much appreciated.

 

Thanks,

Ketan

 

Best Answer chosen by Admin (Salesforce Developers) 
Flight PlanFlight Plan

It seems that the formula field that you are refering on the site page act as a literal string value not a actual html image attribute
That's why it showing the complete string that you have computed using formula field.

Instead of doing this you can collect the formula field in javascript/custom code , format it (html encoding)and then write it to innerHTML of DOM structure

Hope this help you !!!!