ManagedCloud-Hosting Posted April 30, 2020 Share Posted April 30, 2020 Hi, I request help on how to add a menu here, how to do this as we only use WHMCS for billing... I need to add - Support -> where I can set the support URL to open in a new tab Thanks... 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted May 1, 2020 Author Share Posted May 1, 2020 (edited) Hi @brian! My Issue was resolved...Thank you so much :) This resolved my problem...only thing left is - How to make these menu items open in a new tab ? <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); $primaryNavbar->addChild('newhome',array('label' => Lang::trans('hometitle'),'uri' => 'https://my site/','order' => 1,'icon' => 'fa-home',)); if (!$client && !is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home')->setUri('clientarea.php'); } }); POST - Best Wishes #StaySafe Edited May 1, 2020 by VirtualWorldGlobal 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 1, 2020 Share Posted May 1, 2020 as you have found, that's going to be a primarynavbar hook. https://developers.whmcs.com/hooks-reference/client-area-interface/#clientareaprimarynavbar 6 minutes ago, VirtualWorldGlobal said: only thing left is - How to make these menu items open in a new tab ? you set a 'target' attribute in the hook. $primaryNavbar->getChild('Home')->setUri('clientarea.php')->setAttribute('target','_blank'); 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted May 1, 2020 Author Share Posted May 1, 2020 Sorry I tried to set as below, but not working... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); $primaryNavbar->addChild('Sales',array('label' => Lang::trans('Sales'),'uri' => 'https://www.domain.com.com/sales/','order' => 1,'icon' => 'fa fa-shopping-cart',)); if (!$client && !is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home')->setUri('clientarea.php')->setAttribute('target','_blank'); } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 1, 2020 Share Posted May 1, 2020 14 minutes ago, VirtualWorldGlobal said: Sorry I tried to set as below, but not working... it works, but I think I assigned the target to the wrong child... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); $primaryNavbar->addChild('newhome',array('label' => Lang::trans('hometitle'),'uri' => 'https://www.google.com/','order' => 1,'icon' => 'fa-home',))->setAttribute('target','_blank'); if (!$client && !is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home')->setUri('clientarea.php'); } }); 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted May 1, 2020 Author Share Posted May 1, 2020 🍹 👏 Working Now :) 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted May 1, 2020 Author Share Posted May 1, 2020 By any chance can we add a drop down ? Network >> System Status (Open In_New Tab) >> System Alerts (Open In_New Tab) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 1, 2020 Share Posted May 1, 2020 1 hour ago, VirtualWorldGlobal said: By any chance can we add a drop down ? if you take a look at the link in my first post, that creates a dropdown. 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.