hpk Posted July 13, 2015 Share Posted July 13, 2015 Hello again, Does anyone know how to change the menu items in the V6 templates? I need to include some custom menu items and change link for the 'Home' page. However I am unable to find any setting within whmcs or in the template file itself. Please guide. Regards, Israr 0 Quote Link to comment Share on other sites More sharing options...
TheTechLounge Posted July 13, 2015 Share Posted July 13, 2015 (edited) The menu's are now controlled via Hooks. Start off here http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet Here is my menu.php hook file as an example; <?php $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; /** If the user is logged in.**/ if ($ca->isLoggedIn()) { add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { /** Rename the "Home" menu item. **/ $primaryNavbar->getChild('Home') ->setLabel('Account Overview'); /** Remove unwanted menu items from the support menu **/ $primaryNavbar->getChild('Support') ->removeChild('Announcements') ->removeChild('Downloads'); /** Change the URL of the knowledgebase to point at Zendesk **/ $primaryNavbar->getChild('Support') ->getChild('Knowledgebase') ->setUri('https://support.thetechlounge.co.uk'); /** Add CSF Manager to the Support Menu **/ $primaryNavbar->getChild('Support') ->addChild('Firewall Management', array( 'label' => 'Manage Firewall', 'uri' => 'index.php?m=csfmanager', 'order' => '1', )); }); } /** If the user isn't logged in. **/ else { add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->getChild('Home') ->setLabel('Account Overview'); }); } Edited July 13, 2015 by TheTechLounge 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.