Modify Category Listings | Last Update: 6th September, 2005 Article ID: 247 |
- Introduction
- Code Explanation
- Remove Category Arrows
- Add a Horizontal Rule
Introduction
There are a number of simple modifications that can be used to change the graphical output of the category names in the category box. The code that draws the box is in catalog/includes/boxes/categories.php.
Code Explanation
Creates the parent category tree. Do not modify.
$osC_CategoryTree = new osC_CategoryTree;
Sets the breadcrumb trail for navigation, and highlights the current category with bold tags.
$osC_CategoryTree->setCategoryPath($cPath, '<b>', '</b>');
Places a comma and space after each parent category name.
$osC_CategoryTree->setParentGroupString('', '');
Setting a <br> tag within the apostrophes '<br>', '<br>' puts an extra space between the category and the subcategory folders top and bottom in the categories listings. If an <i> (italic) tag is used in the first set of apostrophes the whole category/subcategory listings will be italized.
Places an arrow after each parent category name.
$osC_CategoryTree->setParentString('', '->');
Places a horizontal line after each category.
$osC_CategoryTree->setChildString('', '<hr>');
Leaving the <br> tag in puts the subcategory folder on the line beneath the category folder which is the default setting.
Places spaces before each Child (how much to indent the subcategories from the left margin).
$osC_CategoryTree->setSpacerString(' ', 2);