Jump to content

How do i hide left menu and move it?


obaviet

Recommended Posts

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. :idea:

 

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 by brian!
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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) :?:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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! :roll:

Edited by brian!
Link to comment
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