New Zenner
- Join Date:
- Jun 2009
- Posts:
- 30
- Plugin Contributions:
- 0
Adding subcategory names to categoryListBoxContents
I'm trying to add the subcategory names below the main category names in the categoryListBoxContents div. For instance I want my categoryListBoxContents to look like they do on this page http://www.premiumbrandsaustralia.com.au/
I think I've found the correct page to modify this in category_row.php as I can add plain text in lieu of the subcategory names by simply editing the 'text' => ' ' section.
My question though is how to have it automatically recognise the subcategories and list them. So what I have at the moment is...
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:198px' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a><br />' );
$col ++;
if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
$col = 0;
$row ++;
}
$categories->MoveNext();
}
I'm very new to PHP so please forgive my ignorance and I hope this makes sense... do I need to create a loop which will search for subcategories and then list them, or is there a variable already for subcategories which I can just substitute in place of the $categories->fields['category_name']?
Any help would be appreciated. Thanks.