Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix & document template library folder and type #1702 #1704

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions nodes/core/core/80-template.html
Expand Up @@ -80,6 +80,11 @@ <h3>Details</h3>
<p>It is possible to use a property from the flow context or global context. Just use <code>{{flow.name}}</code> or <code>{{global.name}}</code>.
<p><b>Note: </b>By default, <i>mustache</i> will escape any HTML entities in the values it substitutes.
To prevent this, use <code>{{{triple}}}</code> braces.
<h4>Migrating Template Libraries</h4>
<p>Before Node-RED 0.18.4, library template files were saved in the <i>functions</i> library located in the
Node-RED user directory (typically <code>.node-red</code> in the user's home directory). To access these saved templates,
after upgrading, make a copy of the template files and directories in <code>.node-red/functions</code> to
<code>.node-red/templates</code>.</p>
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this text? My assumption is this will affect a pretty small set of users so would rather not tarnish the node info with this. We can make sure it is highlighted in the release blog post.


<script type="text/javascript">
Expand Down Expand Up @@ -128,12 +133,14 @@ <h3>Details</h3>
mode: 'ace/mode/html',
value: $("#node-input-template").val()
});

RED.library.create({
url:"functions", // where to get the data from
type:"function", // the type of object the library is for
url:"templates", // where to get the data from
type:"template", // the type of object the library is for
editor:that.editor, // the field name the main text body goes to
fields:['name','outputs']
fields:['name'] // fields to save in the library entry
});

this.editor.focus();

$("#node-input-format").change(function() {
Expand Down