Ron the Web Guy Posted May 8, 2020 Share Posted May 8, 2020 How do I remove "View Available Addons" from the client menus? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 11, 2020 Share Posted May 11, 2020 On 08/05/2020 at 05:50, Ron the Web Guy said: How do I remove "View Available Addons" from the client menus? two options (at least when using Six) - you can either remove them using action hooks.... https://docs.whmcs.com/Editing_Client_Area_Menus https://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet ... or you can hide them with CSS (added to css/custom.css in your active template folder)... #Primary_Navbar-Services-View_Available_Addons, #Secondary_Sidebar-My_Services_Actions-View_Available_Addons {display:none;} 2 Quote Link to comment Share on other sites More sharing options...
Ron the Web Guy Posted May 21, 2020 Author Share Posted May 21, 2020 The CSS option worked perfect. Thank you! #Primary_Navbar-Services-View_Available_Addons, #Secondary_Sidebar-My_Services_Actions-View_Available_Addons {display:none;} 0 Quote Link to comment Share on other sites More sharing options...
Ron the Web Guy Posted May 30, 2020 Author Share Posted May 30, 2020 Low priority... So: The View Available Addons showed back up. I am not sure how or why? Does the CSS get overwritten during an update? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 30, 2020 Share Posted May 30, 2020 3 hours ago, Ron the Web Guy said: Does the CSS get overwritten during an update? sadly, yes - if you haven't renamed/duplicated the six template folder, then during an update, those template/css files get overwritten.... including custom.css which makes no sense for WHMCS to overwrite with a blank file - that's been discussed here many times over the years, but they don't see it as a problem... you'll need to check your templates too, as any changes you might have made to them pre-update, might also have been undone.... hooks should be unaffected, but always worth checking that they still work as expected. if you were using the automatic updater, then it should have warned you that you were about to overwrite modified files and suggested taking a copy - generally speaking, it's always good to take a copy of the files and database before running any update - just in case things go wrong. if you wanted to remove those two items using a hook, a quick way would be... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar){ if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services')->removeChild('View Available Addons'); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar){ if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->getChild('My Services Actions')->removeChild('View Available Addons'); } }); 1 Quote Link to comment Share on other sites More sharing options...
Ron the Web Guy Posted May 30, 2020 Author Share Posted May 30, 2020 I appreciate all the extra info. I agree it seems silly that "custom.css" gets overwritten. So: I just removed the custom css and created a new hook with your code and it works perfectly. THANKS! 🙂 I will back up my hooks folder after each change... just in case. 😉 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 31, 2020 Share Posted May 31, 2020 14 hours ago, Ron the Web Guy said: So: I just removed the custom css and created a new hook with your code and it works perfectly. THANKS! 🙂 if you had/wanted to, you could use a hook to add a link to a custom renamed custom.css file that WHMCS wouldn't touch/overwrite during an update. 14 hours ago, Ron the Web Guy said: I will back up my hooks folder after each change... just in case. 😉 it's probably best to backup BEFORE you make any change, rather than after it! 🙂 as I said, the hooks folder should be safe from WHMCS interference... the css and templates are another matter. 1 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.