How to hide/show menu items based on connection status?

Hello, I am looking to show/hide certain items in the application menu depending on the navigation profile used, in order to split the online application from the offline application. I have also created a new module for the offline side of the application. So I have two different navigation profiles, a responsive web PWA and a responsive web offline PWA. When the user is offline, I would like the menu of the PWA responsive web offline to be shown. In the same way, when the user is online, I would like the menu of the PWA responsive web to be shown. I've found in the Atlas_Default file that you can choose the menu between the two profiles, but it's impossible to set a variable to display one menu or the other depending on the user's connection status. Do you have a solution to this problem?   Any help will be welcomed because I'm really stuck with this.  
1 answers

Hi Simon,


What happens when you add both navigation trees to the layout?

Doesn't it automatically show/hide the correct one?


If not, you can create a non-persistent entity with a boolean to store the connectionstatus, and use a dataview with a nanoflowsource around them. In here you can use the IsConnectedToServer javascript action from the NanoflowCommons module to set the boolean. Then you can set conditional visibility based to show/hide the right navtree based on the boolean.