Jump to content

how to remove the left column in some page whmcs 6.1


clasil

Recommended Posts

generally speaking, sentq's suggestion is correct - removal of sidebars is best done using hooks.

 

however, I think with standard cart, removal via hooks is pointless - it just leaves a gap on the left column. :)

 

I think you'll need to modify each template file within that folder that calls the sidebars template... e.g with products.tpl, change line 7 from...

 

<div class="pull-md-right col-md-9">

to..

 

<div class="pull-md-right col-md-12">

 

remove the div block at line 28...

 

<div class="col-md-3 pull-md-left sidebar hidden-xs hidden-sm">
{include file="orderforms/standard_cart/sidebar-categories.tpl"}
</div>

and then at line 32, change the div and remove the include...

 

<div class="col-md-12 pull-md-right">

.. and then make similar changes to the other templates.

 

you may also wish to rename the order-form template folder so make sure you don't overwrite your changes during a WHMCS update.

Link to comment
Share on other sites

Hi CS,

 

you never said you were using Premium Comparison! :)

 

however, the answer still stands - just ignore what I said previously about modifying products.tpl.

 

in PC, that's just the opening page and the sidebars are hidden via a button - if you wanted to remove the button and sidebars from this page, you could edit premium_comparison/products.tpl and remove the {if} block @ line 18 and the div block @ line 26.

 

for the other pages, you will need to modify the templates in "standard_cart", e.g if your hosting product requires a domain, the second page you'll see is standard_cart/configureproductdomain.tpl - follow my instructions from the previous post for products.tpl - the line numbers will be different, but the code should be common to the other templates.

 

change line 7;

remove the div block at line 15;

change line 21 from md-9 to md-12 and remove the include beneath it.

 

and then work your way through the other templates in that folder that use the includes to the sidebar.

 

if you're going to make significant changes such as this, you might want to duplicate the standard_cart folder and edit the copy instead, and then in premium_comparison/theme.yaml and edit the file by replacing "standard_cart" with the new name of your folder..

 

config:
   parent: standard_cart

but if you do this, test the cart thoroughly to ensure that it still works correctly.

Link to comment
Share on other sites

I am trying to remove the left side menu on the Knowledgebase pages. The code I am using is:

 

<?php

 

use WHMCS\View\Menu\Item as MenuItem;

 

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)

{

$primarySidebar->removeChild('Support');

});

 

 

Firstly, is this code correct? Secondly, where do I put the code?

Link to comment
Share on other sites

you should probably have started a new thread about this! :idea:

 

Firstly, is this code correct? Secondly, where do I put the code?

no, the code is incorrect - if you want to remove the support sidebar and/or tag cloud, use the following code...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
       if (!is_null($secondarySidebar->getChild('Support Knowledgebase Tag Cloud'))) {
            $secondarySidebar->removeChild('Support Knowledgebase Tag Cloud');
   }
       if (!is_null($secondarySidebar->getChild('Support'))) {
            $secondarySidebar->removeChild('Support');
   }         
});

if you remove both of them, the knowledgebase pages will adjust their width to fit.

 

create a new file in the includes/hooks/ folder and call it 'kbsidebar.php' and paste the above code into it - then when you refresh the knowledgebase page, the sidebars should be removed.

Link to comment
Share on other sites

  • 4 weeks later...

Hello brian, thanks for your instructions however even if I have removed the {if} block @ line 18 and the div block @ line 26 of templates/orderforms/premium_comparison/products.tpl the look of my cart.php page is still the same:

 

awesomescreenshot.com/07b5d1879d

Edited by Guest
Please Attach Images to Your Posts.
Link to comment
Share on other sites

  • 5 months later...

there's no need to edit the template for this, a simple action hook will remove it and not affect other pages... :idea:

 

so create a file in includes/hooks, give it a filename (e.g alreadyregistered.php) and paste the following code into it...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Already Registered'))) {
               $primarySidebar->removeChild('Already Registered');
   }
});

there is another sidebar shown on the register page, though not on your screenshot, about security questions - if you want to remove them both, then you can use...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Already Registered'))) {
               $primarySidebar->removeChild('Already Registered');
   }
});

add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)
{
   if (!is_null($secondarySidebar->getChild('Why Security Questions'))) {
               $secondarySidebar->removeChild('Why Security Questions');
   }
});

with these sidebar(s) removed, the page will adjust and be shown full width.

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