Forums / Customization from the Admin / Left Column off for some pages, and then On for others...is that possible!

Left Column off for some pages, and then On for others...is that possible!

Started by tcarden on 7 Dec 2012, 3:45 AM · Views: 1,201

Results 1 to 9 of 9
7 Dec 2012, 3:45 AM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Left Column off for some pages, and then On for others...is that possible!

I have to make this ZenCart i'm building look just like the design I've been given.

Can I program so that the Left Column is on only on the Homepage (the Right Column would be off)
and then, on the interior pages the reverse is true i.e., Left Column On, Right Column off

is that possible!

thanks for all the great help so far,

7 Dec 2012, 5:59 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Left Column off for some pages, and then On for others...is that possible!

Have a look at the tpl_main_page.php file
It outlines code to turn on & off columns and look for "this is home page" text

Zen-Venom Get Bitten

7 Dec 2012, 5:45 PM
#3
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: Left Column off for some pages, and then On for others...is that possible!

kobra:

Have a look at the tpl_main_page.php file
It outlines code to turn on & off columns and look for "this is home page" text

Okay I'll try, thanks.

i could probably use some jQuery too, if i can figure a way to create pageId's in JS.

7 Dec 2012, 6:07 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Left Column off for some pages, and then On for others...is that possible!

You don't need jQuery for this, as the facility is built in and simple to use in tpl_main_page.php.
Also, the PHP solution stops processing for the turned-off columns, making your pages faster to load.

8 Dec 2012, 11:26 PM
#5
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: Left Column off for some pages, and then On for others...is that possible!

'Doh! i see the comments in that file now explaining how to do it, thanks

29 Dec 2012, 6:59 PM
#6
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Left Column off for some pages, and then On for others...is that possible!

kobra:

Have a look at the tpl_main_page.php file
It outlines code to turn on & off columns and look for "this is home page" text
is the following path
/includes/templates/template_default/common
where tpl_main_page.php file should be edited to eliminate left column on the home page??

Where in that file is the fix to eliminate left column on the home page?

Using Zen Cart 1.5.1

29 Dec 2012, 7:29 PM
#7
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Left Column off for some pages, and then On for others...is that possible!

OK revised from right to left column.

if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {

$flag_disable_left = true;

and no more left column on the home page.

Using Zen Cart 1.5.1

4 Jan 2013, 6:53 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Left Column off for some pages, and then On for others...is that possible!

Simpler and more reliable:```php
if($this_is_home_page) {
$flag_disable_left = true;
}

9 Jan 2013, 9:39 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Left Column off for some pages, and then On for others...is that possible!

is the following path
/includes/templates/template_default/common
where tpl_main_page.php file should be edited to eliminate left column on the home page??
No
You should make a copy of that file for your template

Zen-Venom Get Bitten