# Possible to hide a menu choice dynamically?

**URL:** <https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831>\
**Category:** Dashboard\
**Created:** [17 August 2021 10:27 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831 "2021-08-17T10:27:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [17 August 2021 10:27 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/1 "2021-08-17T10:27:10Z")

</div>

Hello,  
My question, is it possible to hide a menu choice dynamically?  
For example, depending on a variable defined "false" before, the menu choice "MQTT settings" would not appear.

I have read in the forum if there is a way to dynamically hide a choice in the left menus. But I didn't find the solution. Did I search wrong?

Thanks for the help

example:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/702c72d38fa6c637c60a48cda4362feed20c4dbe.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [17 August 2021 10:53 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/2 "2021-08-17T10:53:06Z")

</div>

Easy to do if you craft your own menu using node-red-contrib-ui-contextmenu - [Contextmenu location - #45 by Paul-Reed](https://discourse.nodered.org/t/contextmenu-location/22780/45)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 August 2021 10:56 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/3 "2021-08-17T10:56:59Z")

</div>

You can use ui-control to enable and disable a tab or show and hide, you can disable and hide in combination to  
e.g.

```auto
[{"id":"aef67b0c.38751","type":"inject","z":"b779de97.b1b46","name":"true","props":[{"p":"enable","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":70,"y":1480,"wires":[["46ccfdb2.490184"]]},{"id":"46ccfdb2.490184","type":"switch","z":"b779de97.b1b46","name":"","property":"enable","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":160,"y":1520,"wires":[["2bddd26.51c5f2e"],["e7f55eab.d7c8f8"]]},{"id":"2bddd26.51c5f2e","type":"template","z":"b779de97.b1b46","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"tabs\": {\"show\": \"Level\", \"enable\": \"Level\"}}","output":"json","x":330,"y":1500,"wires":[["b02f0367.55436"]]},{"id":"e7f55eab.d7c8f8","type":"template","z":"b779de97.b1b46","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\"tabs\": {\"hide\": \"Level\", \"disable\": \"Level\"}}","output":"json","x":330,"y":1540,"wires":[["b02f0367.55436"]]},{"id":"91a293b8.336418","type":"inject","z":"b779de97.b1b46","name":"false","props":[{"p":"enable","v":"false","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":70,"y":1560,"wires":[["46ccfdb2.490184"]]},{"id":"b02f0367.55436","type":"ui_ui_control","z":"b779de97.b1b46","name":"","events":"all","x":510,"y":1520,"wires":[[]]}]

```

change the name "level" in the templates to a name of the tab you want to affect.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [17 August 2021 13:20 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/4 "2021-08-17T13:20:38Z")

</div>

@E1cid Your answer is exactly what I asked for. The answers to the questions come almost before you have time to ask them 🤣

![hide](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/73123b71552cef51b6154b1c00ab248c6de10ae0.gif)

@Paul-Reed Your proposal of floating menus was one of my wishes. I didn't understand the idea of how this node works until you pointed it out to me. It's still a node written in part by Bart 😮  
(it was related to SVG)  
I'll definitely use it. I was looking for sub menus. 👍 👍  
So just don't forget to hide the standard NR menu.  
That's cool.  
Thanks to both of you !

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [18 August 2021 11:46 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/5 "2021-08-18T11:46:41Z")

</div>

So that gave me an idea.  
To make the dashboard multilingual according to a previously defined variable, you just have to use this method to hide the menus of the languages you don't want to see. It becomes quite simple.  
1 Tab in English  
1 Tab in French  
1 Tab in German  
etc... they are the same duplicated and translated.  
and depending on the variable, we hide the desired Tabs dynamically.

---

<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:** [1 September 2021 11:47 UTC](https://discourse.nodered.org/t/possible-to-hide-a-menu-choice-dynamically/49831/6 "2021-09-01T11:47:29Z")

</div>

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