Showing posts with label VF pages Static resources. Show all posts
Showing posts with label VF pages Static resources. Show all posts

Tuesday, July 8, 2014

How to Use Salesforce Static Resource as a Dynamically?

How to Use Salesforce Static Resource as a Dynamically

Let’s suppose we have an archive in static resource with name "Contact" and you want to use this static resource on a page that displays Contact Photos dynamically. Assumption is that the images are stored with same name as product codes.
Code:

//Declare an apex variable which gets the Contact code from an apex property

<img alt="" src="{!URLFOR($Resource.Products,contact_photo)}')" />




 
| ,