You need to sign in to do that
Don't have an account?

Basic Static resource in <img> question
Hi,
I know this is a silly question, but i am not able to see the image when i call a static resource image in to visualforce using <img> tag. This is what i am using right now, and the picture is not appearing in the VF Page, i just see a cross mark instead of the picture.
<img src="{ !$Resource.image_TwitterIcon }" />
I have the above individual picture in static resources. Can any one suggest a way to fix this.
Thanks.
Hi,
I think you should write
<img src="{!URLFOR($Resource.image_TwitterIcon)}" />
Hope this helps you,
Bruno
Hi,
I ve already tried this and it did not help. I get the same X mark instead on the picture.
Thanks.
Static Resources
Here is part of the documentation for Static resources.
Static ResourcesUpload static resources, such as stylesheets and images, into a zip, and then referencethem using the URLFOR formula and $Resource merge field.
For example, if you'veuploaded images/Blue.jpg into a zip called TestZip, reference it like this:
<apex:image url="{!URLFOR($Resource.TestZip,'images/Blue.jpg')}"/>
For more info:
http://www.salesforce.com/us/developer/docs/pages/index.htm
Bruno
Another approach, is to upload each image as a document, then mark it as externally available.
You can then leverage custom settings (ie, Public, Hiearchy) to point to those urls.
The url consists of 3 parts:
force.com domain
id is the image Id (015*)
oid is the org Id (00D*)
https://c.na#.content.force.com/servlet/servlet.ImageServer?id=###p&oid=###
If you use prod as your source, be mindful on refreshes that the oid values can get reset in the settings to the current sandbox org id.
Then, you can create a custom formula that works as an image in a page or list view:
IMAGE($Setup.My_Custom_Settings__c.extMail__c,'New Mail'),
These external images can then also be used in email templates as well.