# Can you create a node that just has a template in it?

**URL:** <https://discourse.nodered.org/t/can-you-create-a-node-that-just-has-a-template-in-it/76433>\
**Category:** Developing Nodes\
**Created:** [11 March 2023 14:36 UTC](https://discourse.nodered.org/t/can-you-create-a-node-that-just-has-a-template-in-it/76433 "2023-03-11T14:36:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shan](https://discourse.nodered.org/u/Shan)\
**Post date:** [11 March 2023 14:36 UTC](https://discourse.nodered.org/t/can-you-create-a-node-that-just-has-a-template-in-it/76433/1 "2023-03-11T14:36:25Z")

</div>

I was wondering whether there is a possibility where I can create a bunch of node-RED nodes to distribute for my app, which in essence just contains certain templates for YAML files.

The idea is to let the user configure the nodes through the editor UI and the custom nodes then file the information out and spew the YAML output to a dedicated file in a directory.

Are the some examples I can look into to achieve this?

Or is it better to create subflows and package them as nodes in this case ?

---

<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:** [11 March 2023 16:12 UTC](https://discourse.nodered.org/t/can-you-create-a-node-that-just-has-a-template-in-it/76433/2 "2023-03-11T16:12:59Z")

</div>

Why let users any where near the editor.  
You could set up custom forms for user input. These forms could then be used to create YAML files.

simple example.

```auto
[{"id":"330cbeb17327e168","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"{\"xmas\":false,\"hens\":2,\"birds\":\"Sparrow\\nShrike\"}","payloadType":"json","x":110,"y":2220,"wires":[["18d8063eeda366fb"]]},{"id":"18d8063eeda366fb","type":"junction","z":"65617ffeb779f51c","x":220,"y":2220,"wires":[["d347426887b4c362"]]},{"id":"d347426887b4c362","type":"ui_form","z":"65617ffeb779f51c","name":"","label":"","group":"2d4fe667.28f8ba","order":19,"width":0,"height":0,"options":[{"label":"xmas","value":"xmas","type":"checkbox","required":true,"rows":null},{"label":"hens","value":"hens","type":"number","required":true,"rows":null},{"label":"birds","value":"birds","type":"multiline","required":true,"rows":3}],"formValue":{"xmas":false,"hens":"","birds":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":310,"y":2220,"wires":[["4b56eac8f66ce123","18d8063eeda366fb"]]},{"id":"4b56eac8f66ce123","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"payload.birds","pt":"msg","to":"$split($$.payload.birds, \"\\n\")[$!=\"\"]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2220,"wires":[["4808d95246bd7868"]]},{"id":"4808d95246bd7868","type":"template","z":"65617ffeb779f51c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"---\n xmas: {{{payload.xmas}}}\n french-hens: {{{payload.hens}}}\n calling-birds:\n {{#payload.birds}}\n - {{.}}\n {{/payload.birds}}","output":"str","x":680,"y":2220,"wires":[["f7fafa6366915278"]]},{"id":"f7fafa6366915278","type":"debug","z":"65617ffeb779f51c","name":"file node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":600,"y":2280,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<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 May 2023 16:13 UTC](https://discourse.nodered.org/t/can-you-create-a-node-that-just-has-a-template-in-it/76433/3 "2023-05-10T16:13:38Z")

</div>

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