Forums / Templates, Stylesheets, Page Layout / Removing categories side box from index page only

Removing categories side box from index page only

Locked

Views: 1,474

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
2 Apr 2009, 12:16 AM
#1
rack14650 avatar

rack14650

New Zenner

Join Date:
Jan 2009
Posts:
13
Plugin Contributions:
0

Removing categories side box from index page only

Title says it all. I am trying to diable the categories sidebox from displaying on the main page. https://www.caitybugscorner.com
Thanks for any help

2 Apr 2009, 12:27 AM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Removing categories side box from index page only

rack14650:

Title says it all. I am trying to diable the categories sidebox from displaying on the main page. www.caitybugscorner.com
Thanks for any help

Ra,
How about trying this little helpful hint from the Tutorials/Faq

  1. Search for:
  2. disable sideboxes
  3. And we get:
  4. https://www.zen-cart.com/tutorials/index.php?article=270

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

2 Apr 2009, 12:29 AM
#3
rack14650 avatar

rack14650

New Zenner

Join Date:
Jan 2009
Posts:
13
Plugin Contributions:
0

Re: Removing categories side box from index page only

I have been trying that exact code and can't seem to get it to work. Yes I am a new zenner but I am quite aware of the search feature. Just don't quite understand it all.

2 Apr 2009, 12:34 AM
#4
rack14650 avatar

rack14650

New Zenner

Join Date:
Jan 2009
Posts:
13
Plugin Contributions:
0

Re: Removing categories side box from index page only

Below is the code from my includes/modules/sideboxes/categories.php

$main_category_tree = new category_tree;
$row = 0;
$box_categories_array = array();

// don't build a tree when no categories
$check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
if ($check_categories->RecordCount() > 0) {
$box_categories_array = $main_category_tree->zen_category_tree();
}
require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');

$title = BOX_HEADING_CATEGORIES;
$title_link = false;

require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
if ($this_is_home_page) {
$show_categories = false;

} else {
$show_categories = true;
}
?>

2 Apr 2009, 1:47 AM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Removing categories side box from index page only

Ra,
Change the category.php to this please:

<?php
/**
 * categories sidebox - prepares content for the main categories sidebox
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: categories.php 2718 2005-12-28 06:42:39Z drbyte $
 */
  
if ($this_is_home_page) {
    $show_categories = false;
  } else {
    $show_categories = true;
  }
  if ($show_categories == true)
{
    $main_category_tree = new category_tree;
    $row = 0;
    $box_categories_array = array();

// don't build a tree when no categories
    $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");

    if ($check_categories->RecordCount() > 0) {
      $box_categories_array = $main_category_tree->zen_category_tree();
    }

    require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
    $title = BOX_HEADING_CATEGORIES;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

2 Apr 2009, 2:47 AM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Removing categories side box from index page only

Ra,
Did that little code work for you??????

You have a few problems on the site, when I click on the Products, About Us.

  1. You need to fix

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

2 Apr 2009, 2:52 AM
#7
rack14650 avatar

rack14650

New Zenner

Join Date:
Jan 2009
Posts:
13
Plugin Contributions:
0

Re: Removing categories side box from index page only

Yes it worked perfectly after I fixed my folder name :oops: Thanks for the heads up on the other problems too. Feel free to nit pick it all you want I like the critism from others Thank you!

2 Apr 2009, 2:58 AM
#8
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Removing categories side box from index page only

Ra,
You are most welcome, glad I could help you with your problem

The fix was placing the tag above the Main Process Block

if ($this_is_home_page) {
$show_categories = false;
} else {
$show_categories = true;
}
if (
$show_categories == true)
then we had to use {} and wrap around the Main Processing Block

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.