djpete Posted July 14, 2015 Share Posted July 14, 2015 I am not familiar with hooks although I managed to add a few tests from your examples. But I am not using Six until there is more info and cheats for this. I went through all the documentation but could not find a hook to add a simple main menu item to the client area. It showed me how to add a submenu but not a main menu item. Also if I use six can I remove or disable the client shortcuts entirely to cpanel as I really don't want my customers getting in there. thanks. I do like the more refined cleaner look of the admin area. Best it's ever looked 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 14, 2015 Share Posted July 14, 2015 (edited) This will add a new menu to navbar only viewable by logged in customers. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); if (!is_null($client)) { $primaryNavbar->addChild('Example') ->setUri('https://www.example.com/') ->setOrder(100); } }); Just add this to a hook file. And for the new cpanel sign on feature here is the docs . http://docs.whmcs.com/CPanel_Single_Sign-On Edited July 14, 2015 by lee-wservices 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 14, 2015 Author Share Posted July 14, 2015 many thanks. I want it to be visible all the time. All I want to do is add a link next to the Home link that says Main Website like I have on the old template 0 Quote Link to comment Share on other sites More sharing options...
thekdoherty Posted July 14, 2015 Share Posted July 14, 2015 I would like to do the same. Did you get this resolved? 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 almost there.. http://www.hostingwebdesign.com.au/customerportal/index.php and if i want to remove some buttons in the main nav? - - - Updated - - - This worked for me.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); { $primaryNavbar->addChild('Main Website') ->setUri('http://www.hostingwebdesign.com.au/') ->setOrder(1); } }); 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 How do I remove some buttons in the main nav? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2015 Share Posted July 15, 2015 How do I remove some buttons in the main nav? http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet#Hiding.2FRemoving_a_Menu_Item 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 yep saw that but it removes a submenu item. I need to remove a main menu item. I go this to work but I would like the code correct please.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->removeChild('Open Ticket'))) { } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2015 Share Posted July 15, 2015 take a look at the code below - one part of it removes a main item menu... http://docs.whmcs.com/Editing_Client_Area_Menus#Move_the_.E2.80.9CContact_Us.E2.80.9D_link_to_the_secondary_navigation_bar_and_add_more_contact_options 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 added this. broke it.. <?php add_hook('ClientAreaNavbars', 1, function () { // Save the "Contact Us" link and remove it from the primary navigation bar. $contactUsLink = $primaryNavbar->getChild('Announcements'); $primaryNavbar->removeChild('Announcements'); }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2015 Share Posted July 15, 2015 remove the $contactuslink line - does it work then? 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 this not working either..broke it <?php add_hook('ClientAreaNavbars', 1, function () { $primaryNavbar->removeChild('Announcements'); }); 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 well I have decided to leave the Announcement link anyway. Can someone double check this code though? I just want to make sure it is 100% correct. It does work but I made it so want to make sure it's right. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->removeChild('Open Ticket'))) { } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2015 Share Posted July 15, 2015 it was very late at night, so I was being less helpful than usual! to remove an item from the navbar, you could use the following... <?php add_hook('ClientAreaNavbars', 1, function () { // Get the current navigation bars. $primaryNavbar = Menu::primaryNavbar(); $primaryNavbar->removeChild('Announcements'); }); 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 15, 2015 Author Share Posted July 15, 2015 thank you. I decided to use the Announcements page now. Does this look ok to you? It works but just want the code right.. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->removeChild('Open Ticket'))) { } }); - - - Updated - - - and here's the end result with quite a few tweaks.. http://www.hostingwebdesign.com.au/customerportal/index.php 0 Quote Link to comment Share on other sites More sharing options...
wpehosting Posted July 17, 2015 Share Posted July 17, 2015 Is there a way to simply change the logo from the WHMCS to my business logo? 0 Quote Link to comment Share on other sites More sharing options...
lee-wservices Posted July 17, 2015 Share Posted July 17, 2015 Find the logo for six template here whmcsroot>/templates/six/img/logo.png 0 Quote Link to comment Share on other sites More sharing options...
wpehosting Posted July 17, 2015 Share Posted July 17, 2015 I've done just that, and it's not switching it over. 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted July 18, 2015 Author Share Posted July 18, 2015 are you using that theme? Did you maybe make a custom theme? Are you in the right directory? 0 Quote Link to comment Share on other sites More sharing options...
rodeoXtreme Posted July 24, 2015 Share Posted July 24, 2015 (edited) I know this s probably a really dumb question but I have to ask this. I used the Social Media example and successfully created a hook and menu for it. I attempted to create another Sub menu in our Services but I have no idea what to name the php file in the hooks directory. The doc reference hooks but what to name the file? Whenever I create a hook file (*php) and add the example code The client area page is blank. When I remove the php file the page properly displays. Edited July 24, 2015 by rodeoXtreme 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted July 29, 2015 Share Posted July 29, 2015 Maybe its me, but dont you think that menu manipulation should be when it comes to theming (not module based) should be in the templates? I understand that moduels should be able to modify menus as well, but I think there should be able to be hooks within template folders as well if thats how you expect menus to be modified. 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.