# Template img element displays local image based on msg.filename / msg.payload

**URL:** <https://discourse.nodered.org/t/template-img-element-displays-local-image-based-on-msg-filename-msg-payload/95553>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [21 February 2025 10:36 UTC](https://discourse.nodered.org/t/template-img-element-displays-local-image-based-on-msg-filename-msg-payload/95553 "2025-02-21T10:36:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [21 February 2025 13:44 UTC](https://discourse.nodered.org/t/template-img-element-displays-local-image-based-on-msg-filename-msg-payload/95553/4 "2025-02-21T13:44:43Z")

</div>

I should have included how to post code also, as your json is corrupt due to forum formatting.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

_[View the full topic](https://discourse.nodered.org/t/template-img-element-displays-local-image-based-on-msg-filename-msg-payload/95553)._
