images referenced in htl templates do not work #1994
-
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.
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.
Indeed, Framework doesn't go as far as parsing code that might generate HTML. This is a case where
FileAttachment
must be called explicitly to register the asset and get its URL: