Hi

I have a heiarchy of categories for my content, which I'd like to list as an expandable list in a block on my sidebar. I don't see any default option in Drupal 5 to do this... Please advise if you know how.

Thanks!

Comments

lurkltd’s picture

Does anyone know how to go about doing this?

lurkltd’s picture


$vid = 1; 

$query = "SELECT * FROM term_data WHERE vid = $vid";
$result = mysql_query($query);
$items = array();
print '<ul>';
while ($category = db_fetch_object($result)) {
print '<li>' . l($category->name , 'taxonomy/term/'. $category->tid) . '</li>';
}
print '</ul>';

I wrote this php that does what I want, but I don't know where to put it. It doesn't seem like a good idea to just put it in page.tpl.php

lurkltd’s picture

figured it out. put it in a module using the module tutorial.

taherk’s picture

If you have completed it , can you post it here?
______________________________________
Drupal Tips, how-to, Themes @ http://mydrupal.com