function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikki_tcsNikki_tcs 

Image not appearing in my custom component home page

Hi,

 

I have a site up and running, and i need to insert an image through an custom home page component. So i Uploaded my image in to static resource and i created a new html area custom component and am trying to display the image inside the custom component. I gave the code as 

<img src="https://na1.salesforce.com/resource/xxxxxxxxxxxxxxxx/Bulb"> . But its not appearing in my site, a blank box is appearing without image and rest of the html text is appearing as declared. Am i doing any flaw here? 

 

Thanks,

Nikki 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

Take a look at this article on how to use static resources in visualforce pages and sites.

When you use sites you are in sites context (force.com domain) not salesforce.com domain.

Best practice is not to hard code any urls but dynamically generate the url so that our code works for sites as well as for salesforce logged in users.