# Use the same ui-template node multiple times

**URL:** <https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [9 February 2024 09:00 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352 "2024-02-09T09:00:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [9 February 2024 09:00 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/1 "2024-02-09T09:00:54Z")

</div>

I am using the same template node multiple times (copies). Let's say I want to change something in the template code. That means, I have to do the same change in all template nodes. Is there a way to avoid this? For example, is it possible to add a `master template` and then the copies would always inherit the code from the master?

EDIT: Or maybe feed the template code from a previous inject node?

---

<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:** [9 February 2024 09:39 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/2 "2024-02-09T09:39:16Z")

</div>

If you read the help text you can leave the template node blank and feed in msg.template

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [9 February 2024 10:35 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/3 "2024-02-09T10:35:51Z")

</div>

I tried but I seem to do something wrong.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [9 February 2024 10:41 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/4 "2024-02-09T10:41:40Z")

</div>

`msg.template` is not supported for DB2.

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [9 February 2024 10:47 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/5 "2024-02-09T10:47:33Z")

</div>

Well it's mentioned [here](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html) 🤓  
Nevermind, maybe a misunderstanding. Thank you anyway!

---

<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:** [9 February 2024 13:10 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/6 "2024-02-09T13:10:40Z")

</div>

My bad did not read the category correctly, I have not looked into this as yet.  
Can you link a JS file? [\<link\>: The External Resource Link element - HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) . Then you could possibly link a file between script tags

Does Dashboard 2 play well with subflows, if so you could add it to a subflow, then you only need to maintain the subflow.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [9 February 2024 13:40 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/7 "2024-02-09T13:40:46Z")

</div>

It's not supported _yet_ is the key here. Have opened an issue as you're one of a few that have asked for this in the past week or two: [Enable dynamic ui-template content with injection of msg.template · Issue #561 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/561)

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [9 February 2024 13:47 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/8 "2024-02-09T13:47:59Z")

</div>

Thanks! It came up where? On git? Sorry, I searched only this forum.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [9 February 2024 14:49 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/9 "2024-02-09T14:49:57Z")

</div>

I can't recall exactly where, but definitely crossed my path a few times. No need to apologise! All feedback and ideas are welcome!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 March 2024 14:50 UTC](https://discourse.nodered.org/t/use-the-same-ui-template-node-multiple-times/85352/10 "2024-03-10T14:50:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
