
Originally Posted by
gjh42
Do you mean horizontally at the base of the header, or in an actual box in the left or right column? The categories-tabs header navigation will show your top categories, and you can use Categories Dressing with its settings to not show top cats in the sidebox.
Yes, I have a navigation bar at the top.
The top-level categories should appear in a list below the navigation bar.
The sub-categories should be displayed in a category-sidebox on the left side.
I have tried the following in my /includes/templates/mytemplate/common/tpl_header.php:
(the remaining task is to hide the top-level categories from the category-sidebox)
Code:
<div class="main_categories" style="">
<ul>
<?php
$main_category_tree = new category_tree;
$check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 and parent_id = 0 limit 1");
if ($check_categories->RecordCount() > 0) {
$box_categories_array = $main_category_tree->zen_category_tree();
}
//echo '<pre>';
//print_r($box_categories_array);
foreach($box_categories_array as $cat) {
if($cat['top'] == 'true') {
echo '<li><a href="'.zen_href_link(FILENAME_DEFAULT, $cat['path']).'"'.($cat['current'] ? ' class="active"' : '').'>'.$cat['name'].'</a></li>';
}
}
?>
</ul>
</div>