How to hide the left menu

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
bmoon
Posts: 24
Joined: 10 May 2016, 21:16

16 Feb 2017, 20:21

I'd like to hide the left menu till the user log's in. Is there anyway to hide and disable the left menu (the activated by the title bar) programmatically?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

20 Feb 2017, 11:39

Maybe you can add following class to layout-menu div inside menu.xhtml

Code: Select all

<div class="layout-menu #{!user.loggedIn ? 'layout-menu-static-inactive': ''}"
Also need to do the same for #menu-button at topbar.

bmoon
Posts: 24
Joined: 10 May 2016, 21:16

20 Feb 2017, 20:52

Thanks for the clue. I actually had to put the menu part on in the template here:

<div class="layout-wrapper #{guestPreferences.menuLayout} #{guestPreferences.orientationRTL ? 'layout-rtl' : null} #{!sessionBean.loggedIn ? 'layout-menu-static-inactive': ''}">

I got the top bar button to rotate with this:

<a id="menu-button" href="#" class="#{!sessionBean.loggedIn ? 'menu-button-rotate':''}">

However, with that said, you can still press the "menu" button when not logged in and get the side menu to toggle out. Is there a way to rotate and disable that button?

NOTE: sessionBean.loggedIn is how I can tell if the user is logged in or not.
Last edited by bmoon on 20 Feb 2017, 21:02, edited 1 time in total.

bmoon
Posts: 24
Joined: 10 May 2016, 21:16

20 Feb 2017, 21:01

OK, i figured out that the menu button is "disabled" if the menu is not rendered. I just added this to the menu.xhtml file:

<pu:menu widgetVar="me" rendered="#{sessionBean.loggedIn}">

With that and the other two class modifiers, the menu is now hidden, the button is rotated and is disabled --> when I log in (sessionBean.loggedIn is true), then the button rotates, the is enabled and the menu slides out :)

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

22 Feb 2017, 13:25

Glad to hear, thanks for the update! Is it resolved?

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests