Hi,
1) The point I was making at the start of this thread is that the code in the template file:
PHP Code:
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= '</div>';
will not display anything until the last line is changed to
PHP Code:
$content .= $add_content .'</div>';
2) The generated list lacks an UL, so in
\includes\modules\sideboxes\TEMPLATE\separate_category_sidebox.php
change this
PHP Code:
$add_content ='';
while (!$categories_ap->EOF) {
$id = $categories_ap->fields['categories_id'];
$name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="index.php?main_page=index&cPath='.$id.'" class="category-top">'.$name.'</a></li>' . "\n";
$categories_ap->MoveNext();
}
to this:
PHP Code:
$add_content ='<ul class="separatesideboxlist">';
while (!$categories_ap->EOF) {
$id = $categories_ap->fields['categories_id'];
$name = $categories_ap->fields['categories_name'];
$add_content .= '<li><a href="index.php?main_page=index&cPath='.$id.'">'.$name.'</a></li>' . "\n";
$categories_ap->MoveNext();
}
$add_content .= '</ul>';
3) The query that gets the category information does not account for languages or table prefixes (I think), so change
PHP Code:
$categories_query_ap = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from categories c, categories_description cd where c.categories_id = cd.categories_id and c.categories_status = 1 and c.parent_id = 76 order by sort_order, cd.categories_name";
to
PHP Code:
$categories_query_ap = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd " .
"where c.categories_id = cd.categories_id
and c.categories_status = 1
and c.parent_id = 2 //select master category
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'" ." order by sort_order, cd.categories_name";
Otherwise it works as advertised, showing a non-expanding list of the subcategories of a master category, which is fine by me
regards
Steve
Bookmarks