Forums / Templates, Stylesheets, Page Layout / turn off side columns on home page (code example)

turn off side columns on home page (code example)

Locked
Results 1 to 5 of 5
This thread is locked. New replies are disabled.
31 Jan 2007, 07:24
#1
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Posts:
837
Plugin Contributions:
1

turn off side columns on home page (code example)

I tried to find this in the forums but couldn't.

This hack turns off one (or both) side columns when you are on your sites homepage only.

If you simply make an override in:
includes/templates/your-template/index/tpl_main_page.php
the changes apply to ALL categories, not just the home page.

Here is simple fix. Add:

if ($cPath == ""){
$flag_disable_right = true;
}

to the above override file and you can turn off your side column(s) on home page only.

Hope this helps someone.

Kiddo
05 Feb 2007, 16:05
#2
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: turn off side columns on home page (code example)

use this instead put at the top of the page after comments:

if ($this_is_home_page == true) {
$flag_disable_right = true;
$flag_disable_left = true;
}
08 Feb 2007, 23:26
#3
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Posts:
837
Plugin Contributions:
1

Re: turn off side columns on home page (code example)

delia:

use this instead put at the top of the page after comments:

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


Thanks Delia, Thats a much nicer solution than mine!

Kiddo
09 Feb 2007, 00:40
#4
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Posts:
2,383
Plugin Contributions:
5

Re: turn off side columns on home page (code example)

you're welcome but real thanks goes to zen cart team for setting things up so nicely!
09 Feb 2007, 02:59
#5
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: turn off side columns on home page (code example)

delia:

use this instead put at the top of the page after comments:

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


You can also write the statement like this:

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


ZC is smart enough to know if the page its on is the home page or not.