Brad (SaneChoice Limited) Posted April 26, 2020 Share Posted April 26, 2020 Hi Community, We have some sidebars in WHMCS but I want to change the order of them. As you can see from the screenshot, Your Recent Tickets is above Support. How do I move Support to the top? I have had a look at the documentation from WHMCS and not quite sure I can find how to easily achieve this. Thanks in advance. Brad 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Stephen Posted April 26, 2020 WHMCS Technical Analyst II Share Posted April 26, 2020 Hello @sanechoice The following should get you started with your customisations. Create a .php file with a descriptive name then include the following content: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { $secondarySidebar->getChild('Recent Tickets') ->setOrder(100); }); Once completed then place this .php file in your WHMCS includes/hooks directory. For your reference https://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet#Re-arranging_Sidebar_Items The main difference here is that you are working with a Secondary Sidebar item. I hope this gives you a good starting point to your customisations. -1 Quote Link to comment Share on other sites More sharing options...
Brad (SaneChoice Limited) Posted April 26, 2020 Author Share Posted April 26, 2020 Thanks for all your help @WHMCS Stephen. Sadly, I only managed to cause a Whoops! error by uploading the file! Ill have to keep playing around but my brilliance in this area is somewhat lacking! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Stephen Posted April 26, 2020 WHMCS Technical Analyst II Share Posted April 26, 2020 Hello @sanechoice Let's look to a different approach to this: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Recent Tickets'))) { $secondarySidebar->getChild('Recent Tickets') ->setOrder(100); } }); This appears to work as expected from my view. 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.