# FAQ: uibuilder - multiple pages from 1 node

**URL:** https://discourse.nodered.org/t/faq-uibuilder-multiple-pages-from-1-node/61031
**Category:** FAQs
**Tags:** uibuilder
**Created:** [9 April 2022 13:58 UTC](https://discourse.nodered.org/t/faq-uibuilder-multiple-pages-from-1-node/61031 "2022-04-09T13:58:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 April 2022 13:58 UTC](https://discourse.nodered.org/t/faq-uibuilder-multiple-pages-from-1-node/61031/1 "2022-04-09T13:58:37Z")

</div>

This is the first in an occasional series of FAQ's about node-red-contrib-uibuilder.

**uibuilder supports serving many pages from a single node.**

The default page is `index.html` and this is what is linked to from the nodes config panel. Something like `http://localhost:1880/myuiburl/`. You could also use `http://localhost:1880/myuiburl/index.html`.

Create any number of other `*.html` pages in the same folder as `index.html` and they are all accessible from the same url pattern, e.g. `http://localhost:1880/myuiburl/page2.html`.

Each page can share the same `index.js` file if that works for you or it can have its own `.js` file. In each case, the `uibuilder.start()` function has to be called to get uibuilder working. Given the improvements in the front end library, you might not even need a separate `.js` file now but rather embed the script directly into the html file.

Note that ALL pages will receive ALL the general messages from the uibuilder node. So you will need to use the `msg.topic` or some other data to recognise data for a specific page if that is what you need. Similarly, you might want to add a specific property to any outgoing msgs so that your Node-RED flow can differentiate between msgs from different pages (if that is needed, you might not need to). Obviously, some messages from Node-RED may contain a specific `msg._socketId` which directs the msg to a specific browser tab.

* * *

If you wish to put pages in a sub-folder, things were slightly more complex _before v5.0.2_. In this case, the uibuilder FE library isn't able to work out the correct namespace and path to the [Socket.IO](http://Socket.IO) client. So in that case, you have to provide the required parameters to the `uibuilder.start()` function. Please see the Tech Docs for details.

However, from v5.0.2 onwards, as long as you allow cookies, the front-end client library can work everything out for itself.

There is still another change you will need if accessing pages in a sub-folder though - _if you are using the recommended relative URL's in your HTML_. In that case, all of the URL's need an extra `../` at the start so that they are correct. Add more of those the deeper you nest your code files. If you are using absolute URL's, everything will still work with no changes.

* * *

One last hint. If you need to know uibuilder's various url and [socket.io](http://socket.io) paths and namespaces for yourself. You can easily access them in your own code with `uibuilder.get('cookies')`. This returns 3 cookies of interest:

```javascript
{
    // The Socket.IO namespace
    "uibuilder-namespace": "components-html",
    // The Node-RED httpNodeRoot setting as this has to
    // be added to the start of all URL paths
    "uibuilder-webRoot": "",
    // A session-persistent, unique client-id for the browser tab in use
    "uibuilder-client-id": "FU9t5iebm1zTQrt0QK4F0"
}

```

Hope this is of interest. If it is, please add some comments about what FAQ's you'd like to see in the future. Thanks, Julian.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 May 2022 13:58 UTC](https://discourse.nodered.org/t/faq-uibuilder-multiple-pages-from-1-node/61031/2 "2022-05-09T13:58:41Z")

</div>

This topic was automatically closed after 30 days. New replies are no longer allowed.
