Skip to content

images referenced in htl templates do not work #1994

Answered by Fil
kylehodgson asked this question in Q&A
Discussion options

You must be logged in to vote

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:

```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}" >

Replies: 1 comment

Comment options

Fil
Jun 8, 2025
Collaborator

You must be logged in to vote
0 replies
Answer selected by kylehodgson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1993 on June 08, 2025 13:35.