Hi,
I would like to add a background image to my component. I've tried these two - they don't work. Please help with the correct syntax.
Solved! Go to Solution.
Views
Replies
Total Likes
Try with below uri context
style="background-image: url(${heroProps.iconImage.imagePath @ context='uri'});">
Try with below uri context
style="background-image: url(${heroProps.iconImage.imagePath @ context='uri'});">
Hi @Tahera_BegumSh ,
Whenever we have to render URL string in HTL, you have to ensure to provide content as uri. This will ensure url string renders properly on generated HTML without any issues.
<div style="background-image: url(${filepath @ context='uri'});">