Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Hide sideboxes on main page

Hide sideboxes on main page

Locked

Views: 4,341

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
4 Dec 2006, 4:14 PM
#1
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Hide sideboxes on main page

Hi,

I wanted to hide the right side boxes on the main page so I created the tpl_main_page in my custom directory to read:

if (in_array($current_page_base,explode(",",'index_default')) ) {
$flag_disable_right = true;
}

I thought this would do the trick and have kept trying but can't seem to get it right. The "space" for the right column still shows and the main content is not filling the screen.

Thanks for you help in advance.

Rick

4 Dec 2006, 4:49 PM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

Try this:

if ($current_page_base == 'index_home') {
$flag_disable_right = true;

4 Dec 2006, 4:55 PM
#3
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: Hide sideboxes on main page

Hi Clyde,

Do I replace the line with yours or in addition to. I tried to replace it and got a parse error.

By the way we live in Colorado Springs too. Small world!!

Thanks

Rick

4 Dec 2006, 5:00 PM
#4
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: Hide sideboxes on main page

Hi Clyde,

Nevermind. The statement you gave me was just missing the end bracket. Once I put that in it worked fine.

Thanks

Rick

4 Dec 2006, 5:03 PM
#5
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

I left out a bracket:

if ($current_page_base == 'index_home') {
$flag_disable_right = true;
}

Replace the line you have with the above.

We live in Security/Widefield.

4 Dec 2006, 5:06 PM
#6
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: Hide sideboxes on main page

Hi Clyde,

My wife's grandparents live there as well. We are close to there. We live at Markscheffel and Bradley.

Concerning the layout. The solution you gave me does not seem to allow me to have sideboxes on other pages.

Thanks

Rick

4 Dec 2006, 5:12 PM
#7
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

Rick,

Hmmmmmm!

What version of ZC are you using? It should work with versions as of 1.3.5 and later.

Let me work on this a bit. I'll find an answer and get back to you.

4 Dec 2006, 5:13 PM
#8
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: Hide sideboxes on main page

Sorry Clyde. I lied. The sideboxes do work on product pages but not top category pages. Does that make sense?

I am updating my old site to 1.36. I have it on my server in another directory to test.

Thanks

Rick

4 Dec 2006, 5:16 PM
#9
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

Makes perfect sense.

try this:

 if ($current_page_base == 'index_home' and $cPath == '') {
 $flag_disable_left = true;
 }
4 Dec 2006, 5:24 PM
#10
disciple avatar

disciple

Totally Zenned

Join Date:
Aug 2004
Posts:
278
Plugin Contributions:
0

Re: Hide sideboxes on main page

Worked perfectly. Thanks!!

I am a manager at the Lonestar Steakhouse on Academy and Montebello. Stop by sometime and I will ensure you a nice dinner at a great price.

Ask for Rick. I work mainly nights.

Thanks again.

Rick

4 Dec 2006, 5:29 PM
#11
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

My daughter's hairdresser is located in the same area. Have had a few good lunches a Lonestar.

regards

9 Jan 2007, 5:26 PM
#12
arpeggio avatar

arpeggio

Zen Follower

Join Date:
Dec 2006
Location:
Tokyo, Melbourne, Shanghai
Posts:
102
Plugin Contributions:
0

Re: Hide sideboxes on main page

Hi. I'm trying to do exactly the same thing,ie: hide the sideboxes on the main page but have them appear on EZpages. I unfortunately still get the sideboxes on the main page. :wacko:

I substituted the code as suggested into both:

\includes\templates\template_default\common\tpl_main_page.php
AND
\includes\templates\CUSTOM_TEMPLATE\common\tpl_main_page.php

just to be sure,
but neither seem to have any effect. I'm using Ver.1.3.7

(also tried keeping original code and adding just the recomended bit but..:()

could you please make suggestions as to what could be causing this. Thank you so much in advance. and sorry for the seemingly easy mistake on my behalf (the code obviously works!) but i'm pretty new at this and well you know how it is....:lamo: thank you.

10 Jan 2007, 2:02 PM
#13
arpeggio avatar

arpeggio

Zen Follower

Join Date:
Dec 2006
Location:
Tokyo, Melbourne, Shanghai
Posts:
102
Plugin Contributions:
0

Re: Hide sideboxes on main page

well I got it!! I only removed "_home" from "index_home" in the recomended code above in customtemplate/common/tpl_main_page.php:

if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_left = true;
}

so now it looks like this:

if ($current_page_base == 'index' and $cPath == '') {
$flag_disable_left = true;
}
of course to get rid of the right hand column & sideboxes also, I just added:

if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_left = true;
$flag_disable_right = true;
}
I don't know why this worked and the other way,"index_home" didn't, but anyone who reads this, well I'm using version:1.3.7 and now ya have 2 ways to try and goodluck!

10 Jan 2007, 2:50 PM
#14
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

For version 1.3.7 the code should be:

 if ($this_is_home_page and $cPath == '') {
 $flag_disable_left = true;
 }
10 Jan 2007, 2:53 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide sideboxes on main page

Note: $this_is_home_page already knows that $cPath is blank ... that is part of the build for this variable ...

$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) ); 
10 Jan 2007, 3:01 PM
#16
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

Thank, Ajeh.

Those commented out code snipets in tpl_main_page.php need to be updated.

So this is the correct code:

if ($this_is_home_page) {
 $flag_disable_left = true;
 }
10 Jan 2007, 3:05 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide sideboxes on main page

They are commented out as they are changing an old method and before we tear somethings out completely we leave it in so that those using the new settings can see how the change happened ...

But the commented code means ... either its left for debugging or it's probably old code left as a tag for now ... :smile:

10 Jan 2007, 3:09 PM
#18
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Hide sideboxes on main page

Understood, Thanks again.

11 Jan 2007, 6:38 AM
#19
arpeggio avatar

arpeggio

Zen Follower

Join Date:
Dec 2006
Location:
Tokyo, Melbourne, Shanghai
Posts:
102
Plugin Contributions:
0

Re: Hide sideboxes on main page

Hey!! wow!! That works too!! Added the new code and lookin' good. xie xie nimen (thanks to both of you!)