5

When extending an app using force:slds

<aura:application extends="force:slds">
    <!--component reference>
</aura:application>

This should give me the logo instead of the alt text, is this a right assumption?

<aura:component>
    <div class="slds-global-header__logo">
        <img src="/assets/images/logo-noname.svg" alt="test" />
    </div>
</aura:component>
9

$Asset is the merge variable to use images or SVG from the design systems .Try below code

<img src="{!URLFOR($Asset.SLDS, 'assets/images/logo-noname.svg.jpg')}" alt="test" />

Update

For lightning components use the lightning:avatar

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_avatar.htm

<aura:component>
   <lightning:avatar src="/images/logo-noname.svg" alternativeText="Codey Bear"/>
</aura:component>
  • 2
    That's new, isn't it? A very nice addition to the platform. – sfdcfox Mar 6 '17 at 20:57
  • Yes thats new addition – Mohith Shrivastava Mar 6 '17 at 21:21
  • @MohithShrivastava Sorry for unmarking this answer from solved. The URLFOR Is not supported in lightning components :(, I get an error "No function found for key: URLFOR: Source" success.salesforce.com/ideaView?id=08730000000Lh2GAAS – Rao Mar 6 '17 at 21:43
  • 1
    lightning:icon and Avatar should cover most of the cases – Mohith Shrivastava Mar 6 '17 at 22:53
  • 2
    Lightning:Avatar worked :). Thanks again for the help Mohith – Rao Mar 6 '17 at 23:35

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.