Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Disable Right Column from index&cPath only

Disable Right Column from index&cPath only

Views: 1,784

Results 1 to 9 of 9
27 Sep 2010, 11:27 AM
#1
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Disable Right Column from index&cPath only

I am trying to disable the right column from product listing pages (index&cPath).

This is what I am doing:

I have inserted the following code in /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
$flag_disable_right = true;

this works great, however I have 18 top level categories & 700 sub-categories.

My question is, is their a way to disable all the cPath extensions without manually inserting them?

27 Sep 2010, 12:17 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Disable Right Column from index&cPath only

it was tricky and don't make much sense but this is the (codes) I used:

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

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

if (in_array($current_page_base,explode(",",'products_new,advanced_search_result,products_all,shopping_cart')) ) {
$flag_disable_right = true;
}

12 Feb 2011, 4:35 AM
#3
ksookma avatar

ksookma

Zen Follower

Join Date:
Aug 2009
Posts:
212
Plugin Contributions:
1

Re: Disable Right Column from index&cPath only

I know this is a delayed response but in case someone else runs upon this post..

In this case I would just put $flag_disable_right = true or left on the view page in the templates/templates folder.

12 Feb 2011, 5:38 AM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Disable Right Column from index&cPath only

I am trying to disable the right column from product listing pages (index&cPath).

rbarbour

index&cPath is used to display all categories and sub-categories (same page) so the only way to disable("right or left") column $flag_disable_right or $flag_disable_left

for 1 individual category or sub-category page would be to insert

if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
$flag_disable_right = true;

into your /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

but to disable("right or left") column on all categories and sub-categories you would have to insert

if ($current_page_base == 'index' and $cPath > 0) {
  $flag_disable_right = true;
} 

above code is different than earlier used code as I have been cleaning up my files.

I have never inserted the $flag_disable_right = true; on individual pages, always inserted in tpl_main_page.php

for pages within your shop you insert the following code in tpl_main_page.php

if (in_array($current_page_base,explode(",",'products_new,advanced_search_result,products_all,shopping_cart')) ) {
$flag_disable_right = true;
} 

I hope this helps!

12 Feb 2011, 5:39 AM
#5
clydejones avatar

clydejones

Deceased

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

Re: Disable Right Column from index&cPath only

rbarbour:

I am trying to disable the right column from product listing pages (index&cPath).

This is what I am doing:

I have inserted the following code in /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
$flag_disable_right = true;

this works great, however I have 18 top level categories & 700 sub-categories.

My question is, is their a way to disable all the cPath extensions without manually inserting them?

You could also use the following:

if ($current_page_base == 'index' and $cPath > '0' ) {
$flag_disable_right = true;
}

22 Mar 2011, 5:48 AM
#6
ljdream00 avatar

ljdream00

Zen Follower

Join Date:
Jun 2007
Location:
Michigan
Posts:
168
Plugin Contributions:
0

Re: Disable Right Column from index&cPath only

:no: I just tried using this and it didn't work for me.

This is suppose to disable the right column in the store, right?
Even the subcatagories?

I'm currently using this file for my product listing that works:
if ($current_page_base == 'index' and $cPath == '65') {
$flag_disable_right = true;
}

But it doesn't work on my subcatagory's page....
I'm at a lost because i want my subcatagories to disable right too, but they're just too many to manually plug in.

clydejones:

You could also use the following:

if ($current_page_base == 'index' and $cPath > '0' ) {
$flag_disable_right = true;
}

22 Mar 2011, 5:59 AM
#7
ljdream00 avatar

ljdream00

Zen Follower

Join Date:
Jun 2007
Location:
Michigan
Posts:
168
Plugin Contributions:
0

Re: Disable Right Column from index&cPath only

:oops:please slap me.....

for some reason my mind has acted like I've never used zencart before.... I see the error now, of course it was "user error"....

ljdream00:

:no: I just tried using this and it didn't work for me.

This is suppose to disable the right column in the store, right?
Even the subcatagories?

I'm currently using this file for my product listing that works:
if ($current_page_base == 'index' and $cPath == '65') {
$flag_disable_right = true;
}

But it doesn't work on my subcatagory's page....
I'm at a lost because i want my subcatagories to disable right too, but they're just too many to manually plug in.

6 Apr 2011, 9:38 PM
#8
lindenboy avatar

lindenboy

New Zenner

Join Date:
Feb 2011
Location:
Indianapolis, IN
Posts:
38
Plugin Contributions:
0

Re: Disable Right Column from index&cPath only

I asked the same question today and received a different although functional answer. Not sure which is better, choose your own adventure I say:

http://www.zen-cart.com/forum/showthread.php?t=177805

Good luck, and thanks to gjh42.

JJ
https://www.tuxedoparkbrewers.com
Zen Cart 1.3.9h

6 Apr 2011, 10:50 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Disable Right Column from index&cPath only

For many of these situations there are several valid ways to do the job, and the "best" is the one you can understand and maintain and which takes the least processing to execute... often a tossup.