lulzkiller Posted November 23, 2021 Share Posted November 23, 2021 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 ? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 23, 2021 Share Posted November 23, 2021 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"); . 0 Quote Link to comment Share on other sites More sharing options...
lulzkiller Posted November 23, 2021 Author Share Posted November 23, 2021 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'); } }); 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted November 26, 2021 Share Posted November 26, 2021 (edited) 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 November 26, 2021 by pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
lulzkiller Posted November 26, 2021 Author Share Posted November 26, 2021 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. 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.