Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Turn off categories sidebox for ==Main_Pages?

Turn off categories sidebox for ==Main_Pages?

Views: 789

Results 1 to 4 of 4
29 Jan 2012, 11:19 AM
#1
obrien48 avatar

obrien48

New Zenner

Join Date:
Apr 2009
Posts:
24
Plugin Contributions:
0

Turn off categories sidebox for ==Main_Pages?

Hi All,

I'm looking to turn off my categories sidebox for my main_pages==

I have ez pages set for my products just don't want the categories sidebox to display when a user jumps to the other info, can some one help me with the code for this please, I was trying to rework a piece of code as below but got nowhere.

Here is a link to my site:http://www.crearty-kids.co.uk/creativity

Here is the code I was looking to rework - it was for banner box 2 (although there may be an easier way!)

// test if box should display
$show_banner_box2 = true;
if (SHOW_BANNERS_GROUP_SET8 == '') {
$show_banner_box2 = false;
}

// do not show if on advanced_search page
if ($current_page_base == 'advanced_search') {
$show_banner_box2 = false;
echo 'I am hiding!!' . $current_page_base;
}

if ($show_banner_box2 == true) {
$banner_box[] = TEXT_BANNER_BOX2;
$banner_box_group= SHOW_BANNERS_GROUP_SET8;

require($template->get_template_dir('tpl_banner_box2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_banner_box2.php');

// if no active banner in the specified banner group then the box will not show
// uses banners in the defined group $banner_box_group
if ($banner->RecordCount() > 0) {

  $title =  BOX_HEADING_BANNER_BOX2;
  $title_link = false;
  require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}

}

29 Jan 2012, 4:11 PM
#3
obrien48 avatar

obrien48

New Zenner

Join Date:
Apr 2009
Posts:
24
Plugin Contributions:
0

Re: Turn off categories sidebox for ==Main_Pages?

Many thanks for your help but I've managed to completely break it now!

Can you take a look for me please :blush:

What I am trying to achieve is to only show the categories sidebox on the three ezpages links I have set as my main nav and then it switches off when user goes to shipping info or any other 'defines page editor' page.

The code I have for the categories side box (module) is now:

<?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 $ */ $main_category_tree = new category_tree; $row = 0; $box_categories_array = array(); if ($main_page=index&cPath='1,2,3,4') { $show_categories = true; } else { $show_categories = false; // 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); } ?>

Many thanks in advance,
Alan

29 Jan 2012, 5:40 PM
#4
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Turn off categories sidebox for ==Main_Pages?

includes>templates>your template>templates>tpl_index_default.php

Just after the <div class="centerColumn" id="indexDefault">
add this line

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

this takes it off the index page. what other pages do you want it removed from?