Forums / General Questions / Restricting sideboxes from showing in ALL categories

Restricting sideboxes from showing in ALL categories

Locked
Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Feb 2009, 00:20
#1
fooddudes avatar

fooddudes

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Restricting sideboxes from showing in ALL categories

I want some sideboxes to be restricted from showing in all categories and subcategories. I have found some information regarding restricting sideboxes from showing for specific pages, but not for all categories.

I have been trying to achieve this by inserting different conditional statements in the following location.

(includes/modules/sideboxes)

I don’t know what to modify in these statements to restrict the sideboxes from all categories. The different statements are show below:

if ($this_is_home_page) {
$show_reviews = true;
} else {
$show_reviews = false;
}

if ($show_reviews == true) {
Defalt Text
}

if (in_array($cPath,explode(",",'1'))) {
$show_reviews = true;
} else {
$show_reviews = false;
}

if ($show_reviews == true) {
}

If you wished to disable for the "contact us" and "terms & conditions":

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

If you wished to disable in category listings:

if (in_array($cPath,explode(",",'3,8')) ) {
$flag_disable_right = true;
$flag_disable_left = true;
}

If you wished to disable in EZ-Pages:

if (in_array($ezpage_id,explode(",",'2,5'))) {
$flag_disable_right = true;
}
17 Feb 2009, 03:06
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Restricting sideboxes from showing in ALL categories

do you want to stop the sidebox from showing ONLY on category/subcategory (ie product listing) pages?
17 Feb 2009, 09:02
#3
fooddudes avatar

fooddudes

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Re: Restricting sideboxes from showing in ALL categories

bunyip:

do you want to stop the sidebox from showing ONLY on category/subcategory (ie product listing) pages?


Yes I want certain sideboxes to stop showing in all category and subcategory pages. I will still need to have sideboxes on these pages i just want to restrict my banner ads from showing.

Thanks in advance!
17 Feb 2009, 14:43
#4
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Restricting sideboxes from showing in ALL categories

Sample code for the file includes/modules/sidebox/banner_box.php:

current code:
// test if box should display
  $show_banner_box = true;
  if (SHOW_BANNERS_GROUP_SET7 == '') {
    $show_banner_box = false;
  }


modified not to show on category/product list pages:
// test if box should display
  $show_banner_box = true;
  if ((SHOW_BANNERS_GROUP_SET7 == '') or ($current_page_base == 'index' && isset($cPath))) {
    $show_banner_box = false;
  }
17 Feb 2009, 14:54
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Posts:
10,324
Plugin Contributions:
0

Re: Restricting sideboxes from showing in ALL categories

Why not look at customized stylesheets?

Use the display: none conditional against the style ID's for the boxes you don't want.

For example, let's say a category with ID=12 exists. If you create a stylesheet called:

c_12.css

and put in it:

#more_information {
display:none;
}


Then, for Category ID 12, the More Information sidebox would be invisible.

LOOK AT CSS_read_me.txt in a css folder of zencart.
18 Feb 2009, 04:01
#6
fooddudes avatar

fooddudes

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Re: Restricting sideboxes from showing in ALL categories

bunyip:

Sample code for the file includes/modules/sidebox/banner_box.php:

current code:
// test if box should display
  $show_banner_box = true;
  if (SHOW_BANNERS_GROUP_SET7 == '') {
    $show_banner_box = false;
  }


modified not to show on category/product list pages:
// test if box should display
  $show_banner_box = true;
  if ((SHOW_BANNERS_GROUP_SET7 == '') or ($current_page_base == 'index' && isset($cPath))) {
    $show_banner_box = false;
  }



Thanks bunyip, that modification worked out perfectly.
07 Jun 2009, 02:26
#7
mlwartman avatar

mlwartman

New Zenner

Join Date:
Jun 2009
Posts:
1
Plugin Contributions:
0

Re: Restricting sideboxes from showing in ALL categories

schoolboy:

Why not look at customized stylesheets?

Use the display: none conditional against the style ID's for the boxes you don't want.

For example, let's say a category with ID=12 exists. If you create a stylesheet called:

c_12.css

and put in it:



Then, for Category ID 12, the More Information sidebox would be invisible.

LOOK AT CSS_read_me.txt in a css folder of zencart.


brilliance.. and built-in as well..