Jump to content

Change order/position of sidebar


Recommended Posts

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

Sidebar Position.png

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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.

 

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated