I'm trying to display a list of terms associated with a node.

Unfortunatley nothing seems to come out. The code I'm using is below.

    $terms = taxonomy_node_get_terms(arg(1));

    $out.= 'Listing Terms<br />';
    foreach($terms as $term){
      $out.='-' . $term->name . '<br />';
    }
echo $out;

What is wrong?

Comments

WorldFallz’s picture

In drupal 6 the taxonomy_node_get_terms function was changed to take a complete node object-- try the following:

$terms = taxonomy_node_get_terms(node_load(arg(1)));

See http://api.drupal.org/api/function/taxonomy_node_get_terms/6 for more info.

fcmisc’s picture

Thanks again WorldFallz. You are a total legend.