images referenced in htl templates do not work #1994
Answered by Fil
kylehodgson asked this question in Q&A
-
| A file that references an image like this will work: whereas code that references an image like this will not: |
Beta Was this translation helpful? Give feedback.
Answered by Fil Jun 8, 2025
Replies: 1 comment
-
| Indeed, Framework doesn't go as far as parsing code that might generate HTML. This is a case where ```js if (observable.params.oem=="BRM AERO") { display(html` <div class="card" style="min-height: 210px;" > <img style="float: right; max-height: 200px;" src="${FileAttachment("/images/b23e.jpg").href}" > |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by kylehodgson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Indeed, Framework doesn't go as far as parsing code that might generate HTML. This is a case where
FileAttachmentmust be called explicitly to register the asset and get its URL: