Jump to content
lulzkiller

Removing sidebar from specific subpages

Recommended Posts

Hi

We're using CloudNS WHMCS module for DNS - But the module have a sidebar on all pages, but its basically useless.

So, how can I remove a sidebar on specific pages ?

Share this post


Link to post
Share on other sites

Would be best to talk to the dev for that module as any solution would require coding.   Using the ClientAreaSecondarySidebar hook and getting deleting the sidebar's element should be possible.   You just need the id/name, should be in the id value of sidebar container, and look for it in the sidebar children array. and just do $menu->delete('useless_sidebar");  .

Share this post


Link to post
Share on other sites
53 minutes ago, steven99 said:

Would be best to talk to the dev for that module as any solution would require coding.   Using the ClientAreaSecondarySidebar hook and getting deleting the sidebar's element should be possible.   You just need the id/name, should be in the id value of sidebar container, and look for it in the sidebar children array. and just do $menu->delete('useless_sidebar");  .

I already talked with the developers, they say its not coming from them.

I tried this hook here - It removes it perfectly. Except it does it on the other products as well, where I need the sidebar.
 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Service Details Overview'))) {
            $primarySidebar->removeChild('Service Details Overview');
   }
   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->removeChild('Service Details Actions');
   }    

});

 

Share this post


Link to post
Share on other sites
On 11/24/2021 at 1:42 AM, lulzkiller said:

I already talked with the developers, they say its not coming from them.

I tried this hook here - It removes it perfectly. Except it does it on the other products as well, where I need the sidebar.
 


<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Service Details Overview'))) {
            $primarySidebar->removeChild('Service Details Overview');
   }
   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->removeChild('Service Details Actions');
   }    

});

 

Set getChild with 'Categories' first and then search for you product group (menuitemname).

https://developers.whmcs.com/themes/sidebars/

Edited by pRieStaKos

Share this post


Link to post
Share on other sites
10 minutes ago, pRieStaKos said:

Set getChild with 'Categories' first and then search for you product group (menuitemname).

https://developers.whmcs.com/themes/sidebars/

I already am - The problem is, this sidebar have same name as the "standard" sidebar, where cpanel information and such is also written. So I need some kind of rule that's like

If module is "CloudNS" remove sidebar, if module is xxxx keep sidebar function.

Skærmbillede 2021-11-26 kl. 13.57.44.png

Share this post


Link to post
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