Forum Discussion

tavasjn24's avatar
4 years ago

Using Assets in custom component

Does anyone know how to use an img asset that we uploaded in a img tag? Anytime I try using the correct path I just get a blank space where the image should be.

2 Replies

  • If you go to Studio > Community Style > Assets Library > Other assets (basically where you upload them), it even gives you the proper FreeMarker code directly for each uploaded asset:

    luk_0-1712221757775.png

     

  • Hello tavasjn24 ,

    Use ${asset.get("/html/assets/image.jpg")} to retrieve the image path.


    Ex:
    <img src="${asset.get("/html/assets/image.jpg")}"  />

    please refer below image and URL for reference.

    manasab_0-1712212838332.png  

    URL:  get("destination_url") (khoros.com)