wulfric Posted January 20, 2017 Share Posted January 20, 2017 i'm cruising over the documentation below but I don't see anything.. perhaps i'm not looking hard enough. i see, almost what i'm looking for, but I don't want to completely remove the sidebar, just remove it on a few select pages, maybe 5 or 6. http://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet http://docs.whmcs.com/classes/7.0/WHMCS/Product/Product.html http://docs.whmcs.com/classes/7.0/WHMCS/Service/Service.html So for example, {if $templatefile == "domaintransfer"} than hide the sidebars. i'll be using this sidebar hook removal for a good chunk of pages. i desire a similar hook, the one below doesn't work. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $templatefile = $domaintransfer; if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Service Details Overview'))) { $primarySidebar->removeChild('Service Details Overview'); } } }); 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted January 21, 2017 Share Posted January 21, 2017 $templatefile = $domaintransfer; has no value (NULL) you need to use: $filename = APP::getCurrentFileName(); this will return current file name without extension, so if you are in "/viewinvoice.php" it will return "viewinvoice" also $_GET is accessible everywhere, for example you may need to remove one of the sidebar panels displayed in My Invoices page, below is how to do it: add_hook("ClientAreaPrimarySidebar", 1, function(MenuItem $primarySidebar){ $filename = APP::getCurrentFileName(); if ($filename=="clientarea" && $_GET['action']=="invoices"){ // Hide Sidebar Code Here } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 21, 2017 Share Posted January 21, 2017 https://forums.whmcs.com/showthread.php?116654-Remove-Sidebar-from-product-detail-page&p=498926#post498926 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.