Rigsby Posted May 6, 2017 Share Posted May 6, 2017 Hi folks The below script adds a navbar drop-down menu pre-login and disappears after login, but does anyone know how to make it do the opposite? I would like to hide a parent pre-login and make it visible post-login. I found it on an earlier thread and thought it was very useful <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); // only add menu item when no client logged in if (is_null($client)) { $primaryNavbar->addChild('Client Portals') ->setOrder(100); $primaryNavbar->getChild('Client Portals') ->addChild('Remote Support', array( 'label' => 'Remote Support', 'uri' => 'http://www.example.com', 'order' => '200', )); $primaryNavbar->getChild('Client Portals') ->addChild('Divider1', array( 'order' => '300', )) ->setClass('nav-divider'); $primaryNavbar->getChild('Client Portals') ->addChild('WebMail', array( 'label' => 'WebMail', 'uri' => 'http://webmail.example.com', 'order' => '400', )); $primaryNavbar->getChild('Client Portals') ->addChild('Divider2', array( 'order' => '500', )) ->setClass('nav-divider'); $primaryNavbar->getChild('Client Portals') ->addChild('WebStats', array( 'label' => 'WebStats', 'uri' => 'http://example.com', 'order' => '600', )); } }); 0 Quote Link to comment Share on other sites More sharing options...
Rigsby Posted May 6, 2017 Author Share Posted May 6, 2017 I bought an awesome module last night which let me fly through many navbar options. It's very affordable and is called WHMCS Advanced Menu Manager. I had been banging my head looking for answers all yesterday but within minutes of installing I was all over it like white on rice, haha. Here's my recent thread with screenshots https://forum.whmcs.com/showthread.php?128534-Hide-Announcements-Knowledgebase-RSS-etc I'm new to PHP and find it fascinating but sometimes I just need to crack on with my day and move to the next part of the project. Good luck 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.