This code is not fully tested, but try it and see. In tpl_categories.php find this block starting around line 31:
if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
$content .= '<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'];
}
``` and add
```php
// gjh42 20070409 display images for category names
$cat_name_display = $box_categories_array[$i]['name'];
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) { //replace numbers with your cat ids separated by commas
$cat_name_display = '<img src="' . HTTP_SERVER . DIR_WS_CATALOG . 'images/catimg' . str_replace("cPath=","",$box_categories_array[$i]['path']) . '.gif">';
}
and replace $box_categories_array[$i]['name'] with $cat_name_display in three places
to get this:```php
if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
$content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
// gjh42 20070409 display images for category names
$cat_name_display = $box_categories_array[$i]['name'];
if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) {
$cat_name_display = '<img src="' . HTTP_SERVER . DIR_WS_CATALOG . 'images/catimg' . str_replace("cPath=","",$box_categories_array[$i]['path']) . '.gif">';
}
if ($box_categories_array[$i]['current']) {
if ($box_categories_array[$i]['has_sub_cat']) {
$content .= '<span class="category-subs-parent">' . $cat_name_display . '</span>';
} else {
$content .= '<span class="category-subs-selected">' . $cat_name_display . '</span>';
}
} else {
$content .= $cat_name_display;
}
This will check whether the category being prepared is on your list, and if so set $cat_name_display to the image source for the respective category. This will be included in the output in place of the text name.
The images should be in the form catimg3.gif or catimg21_57.gif, with the numbers matching the cPath for the category, and located in the main /images/ directory. (It should be possible to substitute DIR_WS_TEMPLATE for DIR_WS_CATALOG and store the images in your template /images/ directory if desired.)
If the present category is not on the list, $cat_name_display will place the text name in its standard position.
The "if (in_array..." test has been proven to work, but the image link building has not been tested in theis implementation.