Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Need help in modifying categories sidebox

Need help in modifying categories sidebox

Locked

Views: 1,095

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
18 Feb 2007, 3:06 AM
#1
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Need help in modifying categories sidebox

I made a change to tpl_document_categories.php so that the links are list item inside a "<ul>" tag.

No matter where I put this file, it doesn't seem to have an effect.
My last trial, I renamed the one that was in the
includes/templates/template_default/sideboxes
to tpl_document_categories_save and then saved my new one there;
but no luck.

the whole thing looks like this; my mods in red:

$content = "";

$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
/* ============================================== /
/
changed the categoriesContent into a UL construct /
/
============================================== */
$content.='<ul id="' . str_replace('_', '-', $box_id . 'NavList') . '>';

for ($i=0;$i<sizeof($box_categories_array);$i++) {
/*
if ($box_categories_array[$i]['has_sub_cat'] or $box_categories_array[$i]['parent'] == 'true') {
$new_style = 'category-parent';
} else {
$new_style = 'category-child';
}
*/
switch(true) {
case ($box_categories_array[$i]['top'] == 'true'):
$new_style = 'category-top';
break;
case ($box_categories_array[$i]['has_sub_cat']):
$new_style = 'category-subs';
break;
default:
$new_style = 'category-products';
}
$content .= '<li><a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
if ($box_categories_array[$i]['current']) {
if ($box_categories_array[$i]['has_sub_cat']) {
$content .= '<span class="category-subs-parent">' . $box_categories_array[$i]['name'] . '</span>';
} else {
$content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>';
}
} else {
$content .= $box_categories_array[$i]['name'];
}
if ($box_categories_array[$i]['has_sub_cat']) {
$content .= CATEGORIES_SEPARATOR;
}
$content .= '</a>';
if (SHOW_COUNTS == 'true') {
if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
$content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
}
}
$content .= '</li>';
}
$content .= '</ul></div>';
?>

18 Feb 2007, 3:12 AM
#2
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

Re: Need help in modifying categories sidebox

Do you have a custom template set up? If you do than it should go in includes/templates/YOUR_CUSTOM_TEMPLATE/sideboxes while leaving the original alone in the default template. If you don't have a custom template...shame on you...than replacing the one in the default template should work.

18 Feb 2007, 3:16 AM
#3
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

Re: Need help in modifying categories sidebox

$content.='<ul id="' . str_replace('_', '-', $box_id . 'NavList') . '">';

is there a double quote missing somewhere?

18 Feb 2007, 9:40 PM
#4
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: Need help in modifying categories sidebox

Good catch Mike! Thanks.

You were right, I did miss that double quote. fixed that.

To answer your questions, the answer is yes, I have a CUSTOM template. (I'd show it to you the review crew, but I'm still developing on localhost.)

And yes... I did create a folder called sideboxes.

..\includes\templates\CUSTOM\sideboxes\tpl_document_categories.php

But still nothing. The generated HTML is still the same.
The information links in the other sidebox come out in an unordered list.
The category links don't.

Thanks again. If you think of anything else, please by all, means talk to me.

Elliot

19 Feb 2007, 1:40 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need help in modifying categories sidebox

Mighty Mike to the rescue again ... :cool:

Getting pretty good isn't he? :smartass:

19 Feb 2007, 1:44 AM
#6
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,841
Plugin Contributions:
0

Re: Need help in modifying categories sidebox

You should see what I can do when I put on the skin tight suit with the big ZC on the chest and the cape......actually the kids just laugh at me and say "dad stop being silly":blush:

19 Feb 2007, 1:50 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need help in modifying categories sidebox

Good thing our colors are not pink, eh? :eek:

20 Feb 2007, 5:14 PM
#8
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: Need help in modifying categories sidebox

Just to follow up....

The tpl_document_categories.php file is not the one that renders the links categories side box.

The wiki, coupled with trial-n-error is really the way to go, but now that its a list construct, I can stylizing it as a rollover list, and man does it look better!!.

Here I come to save the daaaaaaaaaaay, ZC man in on the waaaaaay!!