Sidebar toggle default open or not

0
Hi, I use the sidebar toggle (Mx 5.20) to show or hide the menu and "hard coded" I have to specify if the menu should be open or closed by default. But I want to add this as an option to the user's profile: Menu default visible yes/no. What have I done to get this working: Put the toggle widget in a dataview (in the layout) where the object in the dataview has the user preferences. Based on a value I use conditional visibility to show one of the two toggle buttons. One has default open true, the other obviously false. This does not work because the modeler does not allow me to put a dataview in a layout. Put the dataview in a snippet and put the toggles in there and show the snippet in the layout. That's the trick to get a dataview in a layout. But I cannot put the toggle in a non-layout document so this attempt fails as well. Add 2 user roles (one for closed and one for open) and the user preference adds/removes the appropriate roles. Next control the visibility of the two toggle widgets based on the roles. But I cannot put more than one toggle button in the layout. I am out of options I can think of. Do you have a suggestion? Regards, Paul
asked
2 answers
0

Try solving it with a javascript widget that triggers a click to show the sidebar based on the user setting. This could be loaded based on the attribute value in the view.

answered
0

The default sidebar setting is a boolean, it's either true or false. You cannot set the setting to both in the same page, they're mutually exclusive, no matter how much conditional formatting you apply. As such, your dual sidebar toggle plan is not going to work.

The only way I can imagine this working is using two distinct layouts, but that would also require you to duplicate every single page (with snippets, I suppose); one copy for each layout.

answered