Forums / Templates, Stylesheets, Page Layout / Enable the left column for one page...

Enable the left column for one page...

Locked

Started by alex_clarke on 4 Mar 2007, 11:59 AM · Views: 3,469

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
4 Mar 2007, 11:59 AM
#1
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Enable the left column for one page...

I know that it's possible to turn off the left column completely. And I also know that it's possible to override the left (or even right) column and turn it off for certain pages.

But is this possible...

I would like to turn the left column off for all pages (with the exception of one - not the homepage).

Other than using CSS (which would be quite bulky for this simple opperation) is there an easier way?

Thanks. :)

My Contributions: Zen Lightbox | Best Sellers Reloaded

4 Mar 2007, 12:30 PM
#2
clydejones avatar

clydejones

Deceased

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

Re: Enable the left column for one page...

How 'bout something like this in tpl_main_page.php

if (!$current_page_base == 'yourpagename') {
$flag_disable_left = true;
}

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Mar 2007, 12:54 PM
#3
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Enable the left column for one page...

I really should hang my head in shame!

I remember (before the option via admin to turn off the left/right columns on the homepage was available) asking a very similar question and this was the solution!

Thanks Clyde. You've saved me a lot of time! :)

My Contributions: Zen Lightbox | Best Sellers Reloaded

4 Mar 2007, 1:56 PM
#4
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Enable the left column for one page...

clydejones:

How 'bout something like this in tpl_main_page.php

if (!$current_page_base == 'yourpagename') {
$flag_disable_left = true;
}

Mmm... that didn't appear to work. :(

I'm not sure if this will work at all, because I would first have to turn off the left column via admin and then override the left column for 'yourpagename' in tpl_main_page.php.

However, I don't think you can override columns when they have been turned off (globally) via admin.

What makes me think this...

Show Column Left, unless page override exists?
0= Column Left is always off
1= Column Left is on, unless page override

The above is taken from the admin.

Do you think/know of a work around?

My Contributions: Zen Lightbox | Best Sellers Reloaded

4 Mar 2007, 2:05 PM
#5
clydejones avatar

clydejones

Deceased

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

Re: Enable the left column for one page...

Alex,

It won't work if the left column is turned off globally. You'll have to set the column to 1 in the admin.

Then that peice of code should work to turn off the left column on all pages except the for that one page.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Mar 2007, 4:14 PM
#6
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Enable the left column for one page...

Ok, that makes sense, but it still isn't working. :(

I turned the left column on globally (via admin) and added the following to my tpl_main_page.php...

  if (!$current_page_base == 'welcome') {
	$flag_disable_left = true;
  }

My page (that I've created is called 'welcome'). The above code was added below this code...

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
  }

When viewing my 'welcome' page in the left column is there, but it's also there on all other pages!

Have I added the code incorrectly or forgotten to do something? I'm really stumped with this one!

My Contributions: Zen Lightbox | Best Sellers Reloaded

4 Mar 2007, 4:23 PM
#7
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Enable the left column for one page...

Sorted! :)

I used the following code, which seems to work.

if ($_GET['main_page'] == 'welcome') {
  $flag_disable_left = false;
  } else {
  $flag_disable_left = true;
  }

Hope it helps someone else! :)

Thanks for the help Clyde.

My Contributions: Zen Lightbox | Best Sellers Reloaded

4 Mar 2007, 5:38 PM
#8
clydejones avatar

clydejones

Deceased

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

Re: Enable the left column for one page...

glad you got it working.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

31 Aug 2008, 8:30 PM
#9
qwert302 avatar

qwert302

Zen Follower

Join Date:
Mar 2008
Posts:
148
Plugin Contributions:
0

Re: Enable the left column for one page...

Where exactly did you put that code to get it to work? I'm trying to ger a right side box on my main page only and am having no luck. Thanks.

31 Aug 2008, 8:59 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Enable the left column for one page...

It would go near the top of tpl_main_page.php.

if (!$this_is_home_page) {
  $flag_disable_right = true;
}

You can put it right below this:```php
// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}

1 Sep 2008, 7:48 PM
#11
qwert302 avatar

qwert302

Zen Follower

Join Date:
Mar 2008
Posts:
148
Plugin Contributions:
0

Re: Enable the left column for one page...

I need to ENABLE the right hand column for my MAIN PAGE ONLY. I have tried all permutations of the codes presented but just can't seem to get it to function. It is easy to disable it for the main page only, but so far impossible to enable it for the main page only. Which is crazy to me since showing the right column on the main page only seems to have much more functionality than the opposite.

Has anyone done this on their own page who can show me the exact code they are using?

Thanks.

1 Sep 2008, 8:34 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Enable the left column for one page...

You might try explicitly enabling it for the home page:```php
if (!$this_is_home_page) {
$flag_disable_right = true;
} else {
$flag_disable_right = false;
}

1 Sep 2008, 8:57 PM
#13
qwert302 avatar

qwert302

Zen Follower

Join Date:
Mar 2008
Posts:
148
Plugin Contributions:
0

Re: Enable the left column for one page...

Still nothing.

The code you have written would seem to DISABLE the right box on the MAIN PAGE ONLY and enable it on the rest, but that is not the case. It disables the right box for all pages.

If I invert the false and true statements which would logically ENABLE the right box on the MAIN PAGE ONLY and disable the rest, it instead disables the right box on the main page and enables the rest. The opposite of what the code appears to say!

I am at a complete loss.

1 Sep 2008, 11:26 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Enable the left column for one page...

The test is
if ( !$this_is_home_page)

The ! before $this_is_home_page means "not", so it says "if this is not home page, disable right".

Just in case, try it inverted:```php
if ($this_is_home_page) {
$flag_disable_right = false;
} else {
$flag_disable_right = true;
}

27 Sep 2010, 8:16 AM
#15
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Re: Enable the left column for one page...

Hi,
I want to not show colum or colums fo specific pages.
For istance I do not want to show left colum on a specific EZ page, but show both on other EZ pages. Is this possible? Do I need to hack the code? If yes wich fiile and waht I should add?
Thanks
enzo