Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
914 views
in Q2A Core by

what changes should i do in this function so that it will print alll categories and sub categories

 

 

function nav_item($key, $navlink, $class, $level=null)
{
$this->output('<LI CLASS="qa-'.$class.'-item'.(@$navlink['opposite'] ? '-opp' : '').
(@$navlink['state'] ? (' qa-'.$class.'-'.$navlink['state']) : '').' qa-'.$class.'-'.$key.'">');
$this->nav_link($navlink, $class);
 
 
if (count(@$navlink['subnav'])>0){
 
$this->nav_list($navlink['subnav'], $class, 1+$level);
}
$this->output('</LI>');
}
 
 
 

1 Answer

+2 votes
by

You need to modify the database query performed, rather than the theme function.

To always display the full category hierarchy, modify function qa_db_category_nav_selectspec(...) in qa-db-selects.php by adding:

'SELECT parentid FROM ^categories',

After:

'SELECT categoryid FROM ^categories WHERE '.$identifiersql, // gen below

by
great thanks
...