Palette category order

366 views
Skip to first unread message

Max Hadley

unread,
May 1, 2016, 4:58:47 AM5/1/16
to Node-RED
Can somebody please clarify:

1. What controls the order of the categories in the palette? Is it alphabetical or what?

2. What controls the order of appearance of the individual nodes in a category? Is it the order of declaration in the .js file implementing the server-side of the nodes, or the order in the .html file implementing the editor-side?

Thanks,

Max

Julian Knight

unread,
May 1, 2016, 3:53:01 PM5/1/16
to Node-RED
Regarding #1, I'll let Nick or Dave comment on what happens internally, however just to say that you can control it using the paletteCategories setting. See http://nodered.org/docs/configuration

Nicholas O'Leary

unread,
May 1, 2016, 6:09:32 PM5/1/16
to Node-RED Mailing List
The default set of palette categories is as per the link Julian provided. If a node uses another category, that category will get added to the palette in the order the nodes are loaded.

The order individual nodes depends on the order they are discovered at start-up - so should be consistent across restarts.

Within a module, I think they ought to be in the order they are defined in package.json - but there's quite a lot of async code involved, so it may be possible for that not to be true.

Nick






--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Max Hadley

unread,
May 2, 2016, 4:18:42 AM5/2/16
to Node-RED
Nick,

I don't list the individual nodes in my package.json. A bit more experimentation shows that the order of the nodes in the .html file controls the display order within the palette category. I'm keeping the group of {html editor definition; html help text; javascript registration} together as a group for each node.

Max

Max Hadley

unread,
May 2, 2016, 4:31:18 AM5/2/16
to Node-RED
Another thing: I'd like to call my palette category 'home automation', but spaces are converted to '_' characters. Including a '-' in the category name causes the name to be truncated. Would it be possible to allow a wider set of characters is palette category display names, rather than restricting them to be (what look like) valid Javascript identifiers?

Max
Reply all
Reply to author
Forward
0 new messages