jds Posted March 8, 2022 Share Posted March 8, 2022 Hi, I'm trying to display the website & Security dropdown as seen in client area image uploaded. I would like this dropdown to be present when the client is not logged in as well, so removing the SSL Cert. Web security and VPN from the Store menu and moving to its own dropdown. Any help would be highly appreciated on creating the required hook to implement 0 Quote Link to comment Share on other sites More sharing options...
jds Posted March 17, 2022 Author Share Posted March 17, 2022 For anyone that wanted this in the navbar to none-logged in users here's the code I managed to do myself - Quote <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); if (is_null($client) && !is_null($primaryNavbar->addChild('Website & Security'))) { $primaryNavbar->addChild('Website & Security') ->setUri('#') ->setOrder(30); } if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->getChild('Store') ->removeChild('sitelock') ->removeChild('sitelockvpn') ->removeChild('symantec'); } if (is_null($client) && !is_null($primaryNavbar->getChild('Website & Security'))) { $primaryNavbar->getChild('Website & Security') ->addChild('sitelock', array( 'label' => Lang::trans('Website Security'), 'uri' => 'store/sitelock', 'order' => 10,)); $primaryNavbar->getChild('Website & Security') ->addChild('symantec', array( 'label' => Lang::trans('SSL Certificates'), 'uri' => 'store/ssl-certificates', 'order' => 20,)); $primaryNavbar->getChild('Website & Security') ->addChild('sitelockvpn', array( 'label' => Lang::trans('VPN'), 'uri' => 'store/vpn', 'order' => 30,)); } }); 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.