Netguy Posted December 21, 2019 Share Posted December 21, 2019 Quote <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $client = Menu::context('client'); // remove Network Status menu if (!is_null($primaryNavbar->getChild('Network Status'))) { $primaryNavbar->removeChild('Network Status'); } // remove Announcements menu if (!is_null($primaryNavbar->getChild('Announcements'))) { $primaryNavbar->removeChild('Announcements'); } // remove Knowledgebase menu if (!is_null($primaryNavbar->getChild('Knowledgebase'))) { $primaryNavbar->removeChild('Knowledgebase'); } //remove Store menu if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->removeChild('Store'); } //Add Site builder when not logged in if (!($client)) { $primaryNavbar->addChild('Site Builder') ->setUri('https://nasm.site/whmcs/cart.php?gid=2') ->setOrder(10); } // only if logged in if (($client)) { $primaryNavbar->addChild('Billing') ->setUri('https://nasm.site/whmcs/clientarea.php?action=invoices') ->setOrder(2); } //Add Services Button - this also overrides the default Services Button with the drop down if (($client)) { $primaryNavbar->addChild('Services') ->setUri('https://nasm.site/whmcs/clientarea.php?action=services') ->setOrder(3); } if (($client)) { if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->removeChild('Support'); } } }); This is my hook file currently and I've tried moving the account tab on my homepage to the last using setOrder but I'm failing to do so. Any ideas? This is how the navbar looks like currently. I want to show the "Account" button after Contact Us. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 22, 2019 Share Posted December 22, 2019 16 hours ago, Netguy said: This is my hook file currently and I've tried moving the account tab on my homepage to the last using setOrder but I'm failing to do so. Any ideas? usually, the visible navbar contains two separate navbars - primary (the one you're modifying in the above hook) and secondary (which usually contains "Account")... with Six, and most custom templates, primary is shown on the left; secondary on the right... i'm tempted to think yours is reversed and it's shown secondary first (Account) and primary after that... if that's the case, there is little that can be done with a hook - unless you just wanted to delete Account from the secondary navbar and manually add it to the primary navbar - if you did that, then you could move it to the right with setOrder. otherwise, the order in which the two sidebars are shown is possibly defined in the header template - possibly you could swap their order around in there if Account really is still using a secondary navbar - but i'd really have to see the site to know if Account is a secondary navbar or not. 0 Quote Link to comment Share on other sites More sharing options...
Netguy Posted December 22, 2019 Author Share Posted December 22, 2019 Thank you! that helps. I'm using a proprietary theme. I will hide it from the secondary navbar and add it it into the primary 🙂 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.