Make a button link to another page HTML !?

Hello Imadouino,

I guess the solution relies on the use of the settings.js configuration file in your .node-red folder

When we want to serve local content we need to set up an http static path in this configuration file.

I use Windows10 and configured below path to point to the projects file in the node-red installation.

    // following property can be used to identify a directory of static content
    // that should be served at http://localhost:1880/.
    //httpStatic: '/home/nol/node-red-static/',
    httpStatic: "C://Users/OCM/.node-red/projects",

inside this directory (projects) I created others to serve images, http files, fonts, etc

Users/OCM/.node-red/projects/nrhttp
Users/OCM/.node-red/projects/nrimages
Users/OCM/.node-red/projects/nrfonts

Inside my Node-RED flow i use relative paths from httpstatic (in settings.js) to where my files are stored. For instance, to reach the file f1.html (a test html Hello world) that is inside projects/nrhttp folder I would use:

<td>BANC1</td>
    <td>    <button type="button" class = "eb1" onClick="parent.location='http://127.0.0.1:1880/nrhttp/f1.html'" ></button>   </td>

I tested with your template and it worked fine.

f1

Notes:

1- When changing the settings.js file you need to restart node.red

2- Check if the httpstatic file is shown in the initialization of Node-RED

18 Jun 10:01:06 - [info] Settings file  : \Users\OCM\.node-red\settings.js
18 Jun 10:01:06 - [info] HTTP Static    : C:\Users\OCM\.node-red\projects

1 Like