obaviet Posted April 26, 2016 Share Posted April 26, 2016 Hello everyone, How do i hide left menu and move it?it is a menu for module addons Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 26, 2016 Share Posted April 26, 2016 (edited) you can't move the sidebar in the way you describe, you would need to use two action hooks (written in PHP) - one to remove the sidebar, and another to create the homepage panel... you can do them both in the same file, but as i'm unfamiliar with which addon module this is, it might be safer to use two separate files for now. to remove the sidebar, it's going to need something similar to this... create a file in includes/hooks, call it 'removeplatformsidebar.php' and paste the code below into it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Platform Settings'))) { $secondarySidebar->removeChild('Platform Settings'); } }); I have no idea what the sidebar is actually called, so i'm guessing it's 'Platform Settings' - if it is, the above hook should work and remove the sidebar after you refresh the page; if i'm wrong with its name, the hook should do nothing. if that happens, you'll need to find out the name of the sidebar - that's easily done by looking at the source code of the page in your browser and finding the value of the appropriate "menuitemname" and replacing 'Platform Settings' in the hook code with it. http://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet#Finding_a_Sidebar_Name Creating the homepage panel is very simple too - but as I don't know what those two links do in the sidebar, I can't write that hook for you... if I knew the source of the sidebar content, then it would be simple to write - but the documentation about creating panels is shown below... http://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels Edited April 26, 2016 by brian! 0 Quote Link to comment Share on other sites More sharing options...
gotcha Posted April 28, 2016 Share Posted April 28, 2016 How to remove all the sidebar of template 'six'? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 28, 2016 Share Posted April 28, 2016 How to remove all the sidebar of template 'six'? perhaps take a look at the thread below... if you want to remove them all, then removing references to sidebar.tpl in the templates would probably be the most thorough way... you could remove individual sidebars using hooks, but depending on the page, they may leave a gap on the left (certainly did in earlier v6 versions, don't know if they fixed it in 6.3.1). http://forum.whmcs.com/showthread.php?106435-how-to-remove-the-left-column-in-some-page-whmcs-6-1 0 Quote Link to comment Share on other sites More sharing options...
obaviet Posted April 29, 2016 Author Share Posted April 29, 2016 hello thank you help me but i can not access after use your script 0 Quote Link to comment Share on other sites More sharing options...
obaviet Posted April 29, 2016 Author Share Posted April 29, 2016 perhaps take a look at the thread below... if you want to remove them all, then removing references to sidebar.tpl in the templates would probably be the most thorough way... you could remove individual sidebars using hooks, but depending on the page, they may leave a gap on the left (certainly did in earlier v6 versions, don't know if they fixed it in 6.3.1). http://forum.whmcs.com/showthread.php?106435-how-to-remove-the-left-column-in-some-page-whmcs-6-1 i only need to remove a menu for index page (portal Home page) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 29, 2016 Share Posted April 29, 2016 thank you help me but i can not access after use your script sorry - I meant to say that you'd need to create the homepage panel first before removing the sidebar - otherwise you wouldn't know what its content was! i only need to remove a menu for index page (portal Home page) if you mean the portal page when the client is not logged in, you could try this... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { global $templatefile; if (($templatefile == 'homepage') && (!is_null($secondarySidebar->getChild('Platform Settings')))) { $secondarySidebar->removeChild('Platform Settings'); } }); that should remove it from the homepage for clients/visitors who are not logged in - but it will be visible to clients when they are logged in to their client area (as shown in your first image). you can remove the sidebar from any page, it's just a case of deciding if/where you want it to appear. 0 Quote Link to comment Share on other sites More sharing options...
obaviet Posted April 29, 2016 Author Share Posted April 29, 2016 sorry - I meant to say that you'd need to create the homepage panel first before removing the sidebar - otherwise you wouldn't know what its content was! if you mean the portal page when the client is not logged in, you could try this... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { global $templatefile; if (($templatefile == 'homepage') && (!is_null($secondarySidebar->getChild('Platform Settings')))) { $secondarySidebar->removeChild('Platform Settings'); } }); that should remove it from the homepage for clients/visitors who are not logged in - but it will be visible to clients when they are logged in to their client area (as shown in your first image). yes, all right! you can remove the sidebar from any page, it's just a case of deciding if/where you want it to appear. but i also can not access after use your script 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 29, 2016 Share Posted April 29, 2016 but i also can not access after use your script I tested the script locally before posting and it worked fine - removes the sidebar from the portal page, left it visible everywhere else. are you saying that you're getting a blank page after using the hook ? if so, you shouldn't... what does it say in the activity log (utilities->logs->activity log) 0 Quote Link to comment Share on other sites More sharing options...
obaviet Posted April 30, 2016 Author Share Posted April 30, 2016 I tested the script locally before posting and it worked fine - removes the sidebar from the portal page, left it visible everywhere else. are you saying that you're getting a blank page after using the hook ? if so, you shouldn't... what does it say in the activity log (utilities->logs->activity log) log: Hooks Debug: Hook Defined for Point: ClientAreaSecondarySidebar - Priority: 1 - Function Name: hook_jelastic_secondarymenu it do not work 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 30, 2016 Share Posted April 30, 2016 (edited) can you paste the complete code that you've added to the hook file - and what filename did you give it? also, you haven't mentioned which module is causing this hook to be created, what the code it's creating is - a link to your site would be helpful because trying to write a hook for a module that I know nothing about is not simple! Edited May 1, 2016 by brian! 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.