Forums / Addon Sideboxes / Display Categories In Separate Boxes

Display Categories In Separate Boxes

Views: 41,074

Results 41 to 60 of 63
7 Dec 2010, 8:36 PM
#41
gjh42 avatar

gjh42

Black Belt

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

Display Categories In Separate Boxes

Probably in includes\modules\sideboxes\TEMPLATE\separate_category_sidebox.php, though I don't have the files at hand to say exactly where.

13 Feb 2011, 1:15 PM
#42
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

How do you move the link from the default center to the left side? please help.

13 Feb 2011, 5:45 PM
#43
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

MSGOK:

How do you move the link from the default center to the left side? please help.

Never mind. I finally figured out after messing around on it more.

14 Feb 2011, 11:01 PM
#44
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I ran into another problem. Little more major this time. I want to make several category boxes. I did went over the instructions several times on what to do to make multiple categories. When I thought I done what the instructions says, just about all my sideboxes and center column contents disappears. I am not sure what I am doing wrong. However, what is really strange is that sometimes everything shows up but when i refresh the page they disappear and stay gone. I even try resetting the boxes in the layout box manager and still having this problem.

Here is the link to the website: https://www.mistys-toys.com

Also here is one of the files I tried to edit. Once I had all of the files listed separate-category in this file renamed with the _01 at the end of category:

Separate_category_01_sidebox.php

<?php
/**
 * separate category sidebox - allows a separate category sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright Portions Copyright 2009 www.coolcarpartsonline.com
 * @copyright 2007 Kuroi Web Design
 * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: 2010-09-01 $torvista
 */
/*************
Display Category Content
******************/
  $categories_query_ap = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
                             from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd " .
							 "where c.categories_id = cd.categories_id 
                             and c.categories_status = 1 
							 and c.parent_id = 6
							 and cd.language_id = '" . (int)$_SESSION['languages_id']  . "'" ."
                             order by sort_order, cd.categories_name";
	$categories_ap = $db->Execute($categories_query_ap, '', true, 150);
	$add_content ='<ul class="separatesideboxlist">';
	while (!$categories_ap->EOF)  {
		$id = $categories_ap->fields['categories_id'];
		$name = $categories_ap->fields['categories_name'];
	  	$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$id) . '">'.$name.'</a></li>' . "\n";
	
		$categories_ap->MoveNext();
	}
	$add_content .= '</ul>';
//debug echo $add_content; 
	unset($name);
	
/****************
End Of Additions
********************/
  // test if box should display
  $show_separate_category_01_sidebox = true;

  if ($show_separate_category_01_sidebox == true) {
      require($template->get_template_dir('tpl_separate_category_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_separate_category_sidebox.php');
      $title =  BOX_HEADING_SEPARATE_CATEGORY_01_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

Also this file:

<?php
/**defines for Separate Category Sidebox
 */
define('BOX_HEADING_SEPARATE_CATEGORY_01_SIDEBOX', 'Toys');
define('TEXT_SEPARATE_CATEGORY_01_SIDEBOX', '');
?>

Please help.

Michelle

14 Feb 2011, 11:13 PM
#45
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I left something out that from my previous post:

I should also mentioned that I had the template separate category sidebox files renamed with _01 at the end of once at this part:

[PHP]require($template->get_template_dir('tpl_separate_category_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_separate_category_sidebox.php'); [PHP]

Please help, this error has really gotten me stumped.

15 Feb 2011, 3:37 PM
#46
gjh42 avatar

gjh42

Black Belt

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

Re: Display Categories In Separate Boxes

Back up a little... What is your ultimate purpose with these separate category boxes? Do you just want to display those categories in emphasized containers instead of inline with the other categories? Do you want them in the separate boxes as well as in the standard categories sidebox? Do you want to display them somewhere else on the page, or only under certain circumstances? These factors will affect what is the best route to get your desired display.

15 Feb 2011, 3:43 PM
#47
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I want them separate but to the side like the regular category sidebox but in multiple boxes.

15 Feb 2011, 8:13 PM
#48
gjh42 avatar

gjh42

Black Belt

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

Re: Display Categories In Separate Boxes

Then you can use Categories Dressing to get a display like you have shown, without having to modify/clone mods. There are define statements to set and stylesheet rules to add that can do these things, discussed in the readme.html with the mod. Since there are so many possibilities, specific layouts can be discussed in the Categories Dressing support thread.

15 Feb 2011, 8:41 PM
#49
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

gjh42:

Then you can use Categories Dressing to get a display like you have shown, without having to modify/clone mods. There are define statements to set and stylesheet rules to add that can do these things, discussed in the readme.html with the mod. Since there are so many possibilities, specific layouts can be discussed in the Categories Dressing support thread.

Okay so I do not need to use this mod? I want to know why they and everything else disappears.

P.S. I want to get my boxes to show something like what is on this site: http://www.xtoysusa.com/ Caution: This is an adult toy store.

15 Feb 2011, 9:07 PM
#50
gjh42 avatar

gjh42

Black Belt

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

Re: Display Categories In Separate Boxes

No, you do not need to use the separate category mod for this. In fact, the layout you refer to, moreso than your current site state, is exactly what Categories Dressing was originally designed to do: add nice headings at desired places in the categories menu.

15 Feb 2011, 10:34 PM
#51
msgok avatar

msgok

New Zenner

Join Date:
May 2006
Posts:
41
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

gjh42:

No, you do not need to use the separate category mod for this. In fact, the layout you refer to, moreso than your current site state, is exactly what Categories Dressing was originally designed to do: add nice headings at desired places in the categories menu.

Okay fantastic, i will use the category dressing instead.

26 Sep 2012, 9:47 AM
#52
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Display Categories In Separate Boxes

The current version 1.2 has a problem.

It uses a variable $name which is unset after the routine..this unsets $name used in the contact us page to pre-populate the name field when a client is logged in.

I suggest this change from

	while (!$categories_ap->EOF)  {
		$id = $categories_ap->fields['categories_id'];
		$name = $categories_ap->fields['categories_name'];
	  	$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$id) . '">'.$name.'</a></li>' . "\n";
		$categories_ap->MoveNext();
	}
	$add_content .= '</ul>';
//debug echo $add_content; 
	unset($name);

to

	while (!$categories_ap->EOF)  {
        $categories_id = $categories_ap->fields['categories_id'];
	$categories_name = $categories_ap->fields['categories_name'];
	$add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$categories_id) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
	$categories_ap->MoveNext();
	}
	$add_content .= '</ul>';

//echo $add_content;//debug to check query is ok 
	//unset($categories_name);//was $name but overwrote $name in contact_us

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

19 Dec 2012, 8:07 PM
#53
fisherman avatar

fisherman

New Zenner

Join Date:
Aug 2012
Posts:
23
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Will this work with 1.5?

17 Jan 2013, 6:46 PM
#55
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Display Categories In Separate Boxes

I've just noticed that the array that gets used for this produces an incomplete cPath.
ie if your parent id is 2 and the category is 345, the link goes to 345 instead of 2_345 which will result in incomplete breadcrumbs.

This is how I fixed it:
in \includes\modules\sideboxes\YOUR_TEMPLATE\separate_category_sidebox.php

change

while (!$categories_ap->EOF)  {
        $id = $categories_ap->fields['categories_id'];
        $name = $categories_ap->fields['categories_name'];
        $add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$id) . '">'.$name.'</a></li>' . "\n";
        $categories_ap->MoveNext();
    }

to

    while (!$categories_ap->EOF)  {
        $categories_path = zen_get_path($categories_ap->fields['categories_id']);
        $categories_name = $categories_ap->fields['categories_name'];
        $add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&'.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
        $categories_ap->MoveNext();
    }

Note I have also changed the variable names for clarity and added a css class to the link.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

17 Jan 2013, 11:23 PM
#56
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Display Categories In Separate Boxes

I need to eat the previous post, the "fix" worked at the time but not later, this appears to work consistently:

while (!$categories_ap->EOF)  {
        $categories_path = zen_get_generated_category_path_rev($categories_ap->fields['categories_id']);//debug echo '$categories_path='.$categories_path.'<br />';
        $categories_name = $categories_ap->fields['categories_name'];
        $add_content .= '<li><a href="' . zen_href_link(FILENAME_DEFAULT, '&cPath='.$categories_path) . '"><span class="catSpan">'.$categories_name.'</span></a></li>' . "\n";
        $categories_ap->MoveNext();
    }

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

15 May 2013, 3:16 AM
#57
jabe00 avatar

jabe00

New Zenner

Join Date:
Feb 2009
Posts:
32
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

Hello,

I'm building my site and I'm using this mod on my site, but the side-box looks very different to my other template side-box, can someone put me in the right direction to show the information like the other templates side-box.

Here is my site ```
http://compuservicesj.com/store/


Thanks
Jose
15 May 2013, 4:15 AM
#58
gjh42 avatar

gjh42

Black Belt

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

Re: Display Categories In Separate Boxes

Add to your stylesheet```
.separatesideboxlist>li {margin-left: -3em; list-style: inside url(../images/bc_info.gif);line-height: 2.0em; border-bottom: 1px dashed #aabbcc;}

19 May 2013, 8:58 PM
#59
jabe00 avatar

jabe00

New Zenner

Join Date:
Feb 2009
Posts:
32
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

gjh42:

Add to your stylesheet```
.separatesideboxlist>li {margin-left: -3em; list-style: inside url(../images/bc_info.gif);line-height: 2.0em; border-bottom: 1px dashed #aabbcc;}


Thanks....
20 Aug 2013, 3:13 PM
#60
rmsimp avatar

rmsimp

New Zenner

Join Date:
Feb 2011
Posts:
14
Plugin Contributions:
0

Re: Display Categories In Separate Boxes

I have been using this mod for over a year and love it. I had 4 separate categories set up and working properly. I just added a new category and set it up as the others. I am only getting the heading no products under the heading. I can change the includes/modules/sideboxes/ mytemplate line for and c.parent_id = 20 to another category id and change the separate_category_sidebox_04.php to separate_category_sidebox_03.php, and evey thing works fine. Any help would keep what little hair I have.