# Accessing dashboard tabs by name

**URL:** <https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068>\
**Category:** Dashboard\
**Created:** [2 January 2023 15:27 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068 "2023-01-02T15:27:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [2 January 2023 15:27 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/1 "2023-01-02T15:27:21Z")

</div>

Hi @knolleary

This topic has been discussed in the past, but I did not come across any closure.  
Our projects require dashboard tabs to be rendered into iFrames (via direct URLs) and not be selected from a menu. We currently use the **.../ui/#!/\<Tab Id\>** URL convention, which works well. However, the id represents the tab's position in the dashboard menu, and is sensitive to editor changes (tab reorder, empty/inactive tabs etc.). It would be preferable for us to address dashboard tabs by their name.

The **ui control** node does allow specifying the tab name, but as far as I know it cannot render it to an iFrame nor allow adding parameters to the URL. Another thing I tried was to resolve the id via the **GET/flows** admin API, but the returned tab objects do not have the id property.

In a previous thread ([Here](https://discourse.nodered.org/t/help-with-this-node-that-lists-the-dashboard-menu/17359)), @Nxito found a nice way to query & lookup the dashboard ids, by tweaking the dashboard's **io.js** source file:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6ac4a5c7438609063571b6acbeceedbab1fab7ca.png)  
This solution works well, but I am reluctant about tweaking OOTB product code (and redo it upon upgrades). Hence, I am wondering if there is any other solution, e.g.:

- Providing an additional URL convention, based on tab name
- Formally adding the **menu** property in the **io.js** file
- Including the tab Id property in **GET/flows**

Thanks,  
@omrid

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [15 January 2023 14:11 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/2 "2023-01-15T14:11:30Z")

</div>

Hi @TotallyInformation,  
As you are the real expert here, I'm copying you on this discussion, and will be thankful for your advice.

I know the best way forward will be to use your UI Builder 😁 (and this is definitely our plan!), but for our immediate project needs, I need to decide if it would be safe/wise for me to tweak the **io.js** file of the standard dashboard suite, to enable direct access by name to dashboard tabs.  
Thanks in advance!

---

<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:** [15 January 2023 17:55 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/3 "2023-01-15T17:55:39Z")

</div>

> [@omrid](#):
>
> I need to decide if it would be safe/wise for me to tweak the **io.js** file of the standard dashboard suite, to enable direct access by name to dashboard tabs.

Well, I am certainly not the expert on this, that would be Dave.

However, my view would be that it isn't safe or wise except as an acknowledged, cludgy, potentially fragile temporary work-around.

But if you are desperate and as long as you have control over when the Node-RED install from npm gets updated, you may be OK.

> [@omrid](#):
>
> Our projects require dashboard tabs to be rendered into iFrames (via direct URLs) and not be selected from a menu.

Honestly though, I'm struggling to understand why this would ever be needed/wanted.

Have you checked something like this to handle the change in the front-end?

> <https://stackoverflow.com/questions/36236612/handling-page-or-tab-change-in-angualajs/36237108#36237108>

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [16 January 2023 10:07 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/4 "2023-01-16T10:07:43Z")

</div>

For what it's worth, I tend to think it would be good to address tabs by their name or an ID that doesn't change. I have been working around this for a while. But every now and then I pull up a link saved to e.g. my iphone home screen to turn the hallway lights on and I'm presented with the basement light switches 😛

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [16 January 2023 10:38 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/5 "2023-01-16T10:38:53Z")

</div>

> [@TotallyInformation](#):
>
> Have you checked something like this to handle the change in the front-end?

Thanks for the information.  
Unfortunately, in the specific project I'm referring to, we integrate our flows with an external system. We need to give them direct URLs, which they open in self-contained iFrames. these URLs include parameters such as username, role etc., which determine the enabled functionality.

Tweaking the **io.js** file enables me to programmatically open a tab by name, but I guess you are right: It would be a poor practice to meddle with framework source files.

Who in the Node-red dev team is in charge of dashboard feature requests?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 January 2023 12:26 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/6 "2023-01-16T12:26:28Z")

</div>

Hi - currently that would be me.  
I'm not against this idea. Not sure we need to export the whole of the menu object though ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 January 2023 15:12 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/7 "2023-01-16T15:12:29Z")

</div>

pushed a 3.4.0-beta to test to master branch  
(not on npm)

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [16 January 2023 16:48 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/8 "2023-01-16T16:48:49Z")

</div>

> [@dceejay](#):
>
> I'm not against this idea. Not sure we need to export the whole of the menu object though ?

Thanks for stepping in. I believe the best solution is to provide an additional URL convention which opens a tab directly by name.  
If the direct URL today is formatted as **\<host\>:1880/ui/#!/\<tab Id\>[?...]**, I would hope to have an additional URL option, something like **\<host\>:1880/ui/#!/\<tab name\>[?...]** or similar.

If not feasible any time soon, some alternatives can be:

1. An admin API which lists the dashboard tab names & Ids
2. Enhance **ui\_control** to allow concatenating additional parameters at the end of the URL

Thanks!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 January 2023 16:53 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/9 "2023-01-16T16:53:18Z")

</div>

see beta - exactly as you described 🙂 where may need to be \<tab%20name\> ie url encoded for any spaces etc.

---

<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:** [16 January 2023 18:06 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/10 "2023-01-16T18:06:37Z")

</div>

> [@hazymat](#):
>
> For what it's worth, I tend to think it would be good to address tabs by their name or an ID that doesn't change.

Drat, I got confused for a second when I read that as I've just implemented a fixed tab id in uibuilder - but for the BROWSER tab, not an SPA tab like Dashboard. 😁 Too many tabs!

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [17 January 2023 07:39 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/11 "2023-01-17T07:39:28Z")

</div>

> [@dceejay](#):
>
> see beta - exactly as you described 🙂 where may need to be \<tab%20name\> ie url encoded for any spaces etc.

Perfect. Thanks

---

<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:** [16 February 2023 07:39 UTC](https://discourse.nodered.org/t/accessing-dashboard-tabs-by-name/73068/12 "2023-02-16T07:39:37Z")

</div>

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