Jump to content
clasil

how to remove the left column in some page whmcs 6.1

Recommended Posts

Hi guys,

 

how can we remove the left column from some page

 

whmcs 6.1

 

screencast.com/t/qE1OsSCv3OY

 

i just need to know what to comment out .. form the template pages .

 

Thanks

CS

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

HI Brian, thansk for taking the time in checking this for me

 

but i don't see this lines you mention in my template clientarea/templates/orderforms/premium_comparison/products.tpl

 

thanks

Cs

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Guest vuzuggu

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Guest

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.

Share this post


Link to post
Share on other sites
I just want to remove Already Registered Menu on Client Register Templates.

can you add a screenshot so I know exactly what you want to remove...

Share this post


Link to post
Share on other sites
can you add a screenshot so I know exactly what you want to remove...

 

http://prntscr.com/aqpm7d

 

I've tried to remove it but I got blank page on domainchecker.php.. (edited template clientregister.php)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated