Frozen233 Posted July 10, 2015 Share Posted July 10, 2015 Hello I've asked WHMCS Support how to add an additional menu item / button in the top navbar which has to show when people are logged in.... I had this in 5.xx and was quite easy to do however I can't manage to do it now. They told me I can use this code, however I have no clue where I need to paste this code?? At which file? <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->getChild('Support') ->addChild('Emergency Contacts', array( 'label' => 'Emergency Contacts', 'uri' => 'emergency.php', 'order' => '100', )); }); Where am I supposed to paste that? Maybe I feel everything is too complicated but it's very easy at the end, did my best to find it out but can't understand it... Hope someone can help me 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 10, 2015 Share Posted July 10, 2015 (edited) You need turn it into a hook and upload to whmcsroot/includes/hooks. <?php $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; if ($ca->isLoggedIn()) { add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->addChild('Example') ->setUri('https://www.example.com') ->setOrder(70); }); } add_hook("ClientAreaPrimaryNavbar"); ?> Just copy this and make a file called navbar.php ( or anything you like) and paste it in there then upload it will add new link on navbar but only when logged in. Edited July 10, 2015 by lee-wservices 0 Quote Link to comment Share on other sites More sharing options...
Frozen233 Posted July 10, 2015 Author Share Posted July 10, 2015 I managed to do it. Many thanks! Another thing, why does the IP: field nolonger appear in product details in the client area? In 5.xx the IP written in Dedicated IP: was viewable at product details when a customer watched its product, the IP is no longer showing. Can it be enabled somehow? I tried having the product as type "Other " or "Dedicated/ VPS" and with none of them the IP Address is shown, only the icon changes... Thanks - - - Updated - - - Indeed, just tested with the "Five"template and the IP Address appears at product details, but it does not appear at the "Six" template... 0 Quote Link to comment Share on other sites More sharing options...
Phillip Posted August 24, 2015 Share Posted August 24, 2015 This helped me out a lot, nice little tutorial. 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.