I am trying to display a list of records on a public Community page using a Lightning Web Component (to sign up to a programme). I can get a list of records and display an image from a static resource for each one. I would like to attach an image file to each tile to differentiate. I can get either the ContentDocument Id and/or the Version Id, but cannot get either to render the image incorrectly. I am using <img src={fileurl} />
where I am building fileurl in my javascript controller, but nothing I try works. I have tried each of the below with both the Salesforce and Community prefix and the File Id and the Version Id. I am wondering whether I need to build public link for each file or need a Static Resource for each record and link the record to the Static Resource?
- /sfc/servlet.shepherd/version/download/
- /servlet/servlet.FileDownload?file=
- /sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=