Quantcast
Channel: Active questions tagged chatter-feed - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 191

How to fix "src" attribute on images of HTML generated by "forceChatter:feed" Aura component?

$
0
0

Have a Lightning Component where I'm trying to display the Chatter Feed contents of a Case. To accomplish this, I'm using the forceChatter:feed component to pull in the data. It's showing the comments just fine, but any image previews display as broken image links.

Broken Image Picture

When I inspected the image, I noticed the "img" element is using an absolute path for the "src" attribute.

<img height="401" width="314" alt="image.png" src="https://[My Site URL].documentforce.com/servlet/servlet.FileDownload?file=[Image File Id]">

If I remove the absolute path, it properly displays the images.

<img height="401" width="314" alt="image.png" src="/servlet/servlet.FileDownload?file=[Image File Id]">

So, I'm wondering if it's possible to dynamically replace the "src" attribute on all the generated "img" elements after the feed elements are inserted to fix this absolute pathing? Can Lightning Components retroactively have their DOM edited to make fixes like this?


Viewing all articles
Browse latest Browse all 191

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>