Perspective Menu Tree behavior

Good Morning All,

Wasn't really sure what to title this one. The behavior of the Menu Tree component and accord with the displayed page is a little weird/out of sync to me (i may be missing something).

If I navigate through the tree down to a page and then logout (on purpose or timeout or new person logging in) once I'm logged back in I return to the page that was previously on, but the menu has reset to the top level.

In other words lets say I have 2 menu items, FURNACES and PRESSES, and under each I have 3 items for say OVERVIEW, SETTINGS, and CHARTS.

So If I navigate to PRESSES > SETTINGS, then logout, then log back in I'm still on the PRESSES > SETTINGS page, but the menu has reset to the main menu where I only see FURNACES and PRESSES.

My preference would be when the same user logs back in it's on the same screen as when they left but the menu would still be on the same sub-menu (OVERVIEW, SETTINGS, and CHARTS in my example). But if a new user logged in it would be all reset to the main levels.

Alternately, if there's no easy way to accomplish that, I'd be ok if it all reset to the main levels.

Anyone else experience this? Am I setting something wrong or is there some clever way to accomplish?

Thanks in advance

The menu tree is basically just a component that allows you to organize navigation links. It doesn't know what pages are open, what actions it executed, etc.
So when it reloads, it resets.
It's up to you to make it behave as you'd like it to. Which is often not a simple task...

You could use the `page.props.primaryView' property to expand the menu to the currently displayed page:

edit: I just checked what a menu tree looks like, and... I'm afraid there's nothing to tell it programmatically what it should be displaying.
You may have to build your own menu to do this.

Thank you that's what it was looking like to me too. So if the menu always resets, then what I need to do is find a way to just change the view back to the top level view when logging back in. At least that way the menu and the page are in line.

So what I ended up doing was just configuring an onStartup event on the root of my menu view that calls my home page "/".

So now when I log out and log back it it just always resets everything to the same starting place.

Hope this helps someone

1 Like