If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Overriding so that the left hand column dosn't appear on main/home page

Overriding so that the left hand column dosn't appear on main/home page

Locked

Started by helensama on 27 Nov 2007, 1:04 PM · Views: 11,913

Results 21 to 29 of 29
This thread is locked. New replies are disabled.
12 Jan 2009, 4:31 PM
#21
gjh42 avatar

gjh42

Black Belt

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

Overriding so that the left hand column dosn't appear on main/home page

The easiest way is probably to do the standard

if ($this_is_home_page) {
$flag_display_left = false;
}

and then put the code for your image in define_main_page.php, with CSS to position it where the left column would normally be.

19 May 2009, 2:15 PM
#22
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Overriding so that the left hand column dosn't appear on main/home page

clydejones:

Try this:

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

if (in_array($current_page_base,explode(",",'contact_us')) ) {
$flag_disable_left = true;
}

clydejones how would you cut off the right and left side boxes for all the shopping cart pages. Also for the the contact us page. Thank you

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

19 May 2009, 2:25 PM
#23
gjh42 avatar

gjh42

Black Belt

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

Re: Overriding so that the left hand column dosn't appear on main/home page

Add to the code
$flag_disable_right = true;
and add the names of the shopping cart pages to the explode.```php
if (in_array($current_page_base,explode(",",'contact_us,shopping_cart,whatever_else_you_want')) ) {
$flag_disable_left = true;
$flag_disable_right = true;
}

The page name will be in the address bar at the top, after 

main_page=
19 May 2009, 9:29 PM
#24
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Overriding so that the left hand column dosn't appear on main/home page

gjh42:

Add to the code
$flag_disable_right = true;
and add the names of the shopping cart pages to the explode.```php
if (in_array($current_page_base,explode(",",'contact_us,shopping_cart,whatever_else_you_want')) ) {
$flag_disable_left = true;
$flag_disable_right = true;
}

> The page name will be in the address bar at the top, after 
> 
> main_page=

That worked great thank you.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

22 Oct 2009, 2:41 PM
#25
vadimzven avatar

vadimzven

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Re: Overriding so that the left hand column dosn't appear on main/home page

But if I need to remove left or right sidebox from other page, for example from product all page. What should i do?

22 Oct 2009, 3:26 PM
#26
gjh42 avatar

gjh42

Black Belt

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

Re: Overriding so that the left hand column dosn't appear on main/home page

Go to the page where you want to disable the sidebar and look at the address bar at the top. The page name will be after main_page= , and you can put that in the explode as described above.

22 Oct 2009, 5:03 PM
#27
vadimzven avatar

vadimzven

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Re: Overriding so that the left hand column dosn't appear on main/home page

I have url after main page like ... main_page=product_info&cPath=6&products_id=21
but I don't have in a common directory (which is includes/templates/my_template/common) file related to product_info.
There is only tpl_main_page.php. At mean, I'm able to do it only on main page or maybe I have some other ways. Thanks.

22 Oct 2009, 5:14 PM
#28
gjh42 avatar

gjh42

Black Belt

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

Re: Overriding so that the left hand column dosn't appear on main/home page

tpl_main_page.php is the place where you should use the explode test to set $flag_disable_left/right.

tpl_main_page.php handles all pages in your site, calling in other files to help as appropriate.

22 Oct 2009, 5:28 PM
#29
vadimzven avatar

vadimzven

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Re: Overriding so that the left hand column dosn't appear on main/home page

Thank you! Everything is working fine.