This code is WRONG! (it is not RECURSIVE!)

<?php
function theme_taxonomy_nested_tree($tree) {
    if (count($tree)) {
        $output = '<ul class="taxonomy-tree">';
        foreach ($tree as $term) {
            $output .= '<li class="taxonomy-term">';
            $output .= l($term->name, taxonomy_term_path($term));
            if ($term->children) {
                $output .= theme('illogica_category_tree', $term->children);
            }
            $output .= '</li>';
        }
        $output .= '</ul>';
    }
    return $output;
}
?>

This is the RIGHT code:

<?php
function theme_taxonomy_nested_tree($tree) {
    if (count($tree)) {
        $output = '<ul class="taxonomy-tree">';
        foreach ($tree as $term) {
            $output .= '<li class="taxonomy-term">';
            $output .= l($term->name, taxonomy_term_path($term));
            if ($term->children) {
                $output .= theme_taxonomy_nested_tree($term->children);
            }
            $output .= '</li>';
        }
        $output .= '</ul>';
    }
    return $output;
}
?>

WRONG: $output .= theme('illogica_category_tree', $term->children);
RIGHT: $output .= theme_taxonomy_nested_tree($term->children); //recurse

Thanks to *you all* for the code!
hope it helps.
SdP

Comments

jhodgdon’s picture

Category: bug » support
Status: Active » Fixed

This is apparently in response to a comment:
http://api.drupal.org/api/drupal/modules--taxonomy--taxonomy.module/func...

I've added reply to that comment, pointing to this issue.

SdP’s picture

Yes that was the case.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.