Jump to content

Cant remove Sidebar


Recommended Posts

https://whmcs.community/topic/248457-hook-can-not-hide-menu-entry/?do=findComment&comment=1155521

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
   if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) {
            $secondarySidebar->removeChild('Client Shortcuts');
   }
   if (!is_null($secondarySidebar->getChild('Client Contacts'))) {
            $secondarySidebar->removeChild('Client Contacts');
   }
});

 

Link to comment
Share on other sites

8 minutes ago, NicoKuroKusagi said:

Is this the same for the Announcements and Buy New Domain and so on?
Or how to remove these "widgets" or change them?

generally yes - you just need to find out if they're using the Primary or Secondary sidebar, and their name...

https://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet

viewing the source code in the browser will give you that information.

the chances are, whatever you want to modify/change, there will already be a hook posted in these forums that would do it (or would be similar and could be adjusted).

Link to comment
Share on other sites

10 minutes ago, NicoKuroKusagi said:

I see the name of it but where can i see if its primary or secondary?

in the case of Client Contacts..

HNuhEdY.png

but if you know the name, and can't find out if it's primary/secondary, then just try one - if it doesn't work, try the other!

if it's towards the top of the page, it might be primary - if it's in the cart pages, it will be secondary as the cart doesn't use primary sidebars.

Link to comment
Share on other sites

they work in exactly the same way, but you use the homepagepanels hook instead of sidebar...

https://whmcs.community/topic/271777-remove-news-amp-register-domain-section-in-client-area/?do=findComment&comment=1241469

<?php
use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
	$homePagePanels->removeChild('Register a New Domain');
});

 

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