0

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

2

You can simply use the salesforce site class

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_sites.htm

Site.getPathPrefix()

This will give you the prefix of the current site

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.