I want to add a custom image to Salesforce Community

This is aleardy done in a test Sandbox the logo is accessible via {Community_url}/s/{imageName}

I am trying to add than in a new Sandbox

So the question is :

how to add an image in Salesforce to be able to access it, in a lightning component like this

<img src="{!'/s/logo.png'}"  alt="logo" />

Thank you

1 Answer 1


You can simply use the salesforce site class



This will give you the prefix of the current site

<img src="{!'/'+v.prefix+'/logo.png'}"  alt="logo" />
  • Thank you @Ratan, do you know where to upload those images ?
    – benahm
    Feb 3, 2017 at 11:36
  • @benahm you can use static resource or documents
    – Ratan Paul
    Feb 3, 2017 at 11:38
  • @benahm is this issue resolved?
    – Ratan Paul
    Feb 6, 2017 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .