If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / How to let 'Categories sideboxes' disappear at homepage,but appear at other pages?

How to let 'Categories sideboxes' disappear at homepage,but appear at other pages?

Locked

Started by greenlight on 18 Sep 2008, 9:19 AM · Views: 870

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
18 Sep 2008, 9:19 AM
#1
greenlight avatar

greenlight

Zen Follower

Join Date:
Aug 2008
Posts:
138
Plugin Contributions:
0

Post #1 by greenlight

How to let 'Categories sideboxes' disappear at homepage,but appear at other pages? :no::no:

forum.red-host.cn
It is a platform for communicate about SEO, Online store.

18 Sep 2008, 1:01 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

Use this for the code in includes/modules/sideboxes/YOUR_TEMPLATE/categories.php

<?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);
}
?>
19 Sep 2008, 8:32 AM
#3
greenlight avatar

greenlight

Zen Follower

Join Date:
Aug 2008
Posts:
138
Plugin Contributions:
0

Post #3 by greenlight

Thank you!
very very useful :clap::clap:

forum.red-host.cn
It is a platform for communicate about SEO, Online store.

19 Sep 2008, 8:39 AM
#4
greenlight avatar

greenlight

Zen Follower

Join Date:
Aug 2008
Posts:
138
Plugin Contributions:
0

Post #4 by greenlight

Ha ha,my website is online !!:clap::clap:

http://www.boilshop.cn/zencart

forum.red-host.cn
It is a platform for communicate about SEO, Online store.