Using external javascript library

#1

Hi ,

I need a multi-select style form in my node's data-template-name like is provided by http://loudev.com/#demos

I've tried and failed to incorporate the external css and script links into the data-template-name. Is it possible?

Another related question, if I wanted to incorporate a custom image in my node's data-template-name , with the image being held inside the package, what path would I use? I'm finding relative paths don't work.

thanks!

0 Likes

#2

You need to add the npm package as a dependency to your node's package.json so that it gets installed with your node. You then need to work out the correct path to the library so that you can make it available to the front-end. You will find something similar (though more complex as it has to be generic) in my node-red-contrib-uibuilder node.

Once you have worked out the path, you can make it available as a URL, again, uibuilder does this.

For your image, the normal way is to make a folder available for static content by setting httpStatic in settings.js.

0 Likes