Add button with specified Url beside deploy button

Hello,

As i have earlier asked for adding custom button beside Deploy button and i was guided i can create custom button using editor theme but it was not worked (may be i am doing something wrong).

Can you please guide me how can i do it?
End goal is to just put a button beside our Deploy button and on click of that it should redirect to specific location.

What i have done is in screen shot.

Please Help me Out.....................


@knolleary

Hi @dhpatel177

I'm not sure where you were told you can create custom buttons like that using editorTheme, but you cannot do it that way. You can customise the appearance of the Deploy button, but not add other buttons.

You have two options:

  1. modify the editor source code to add whatever you want and then rebuild it

  2. use the editorTheme.page.scripts setting (you can see it at the top of your screenshot) to point at a custom javascript file that will get loaded into the editor. You can use that to dynamically add the button using jQuery.

I have putted some code in deploy.js but it won't worked ....from where this deploy button html is coming from. Please refere screen shot.


@knolleary

How are you running node-red?

After editing any of the editor source code you will need to run grunt build in order to generate the red.min.js file that the editor loads.

Alternatively, run with grunt dev - this will run node-red for you and watch for any changes to the source code, automatically rebuilding the editor code if needed, or restarting Node-RED if any runtime code is modified.

every time when i run this build command "npm run build" i got an error like this.

And have you done what the it says to try to fix it?

Run npm rebuild node-sass to download the binding for your current environment

Getting error like this....

Have you run npm install ?

yes i have

So why has it not installed all of the devDependencies?

What version of npm have you got?

6.9.0 is npm version

let me try some other options

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