Hello,

I've been trying to get the following code to print the associated variable links for a node in my node template, but it won't show any code or links. Do you happen to know what the problem is?

print $node->terms

Thank you!

Comments

styro’s picture

Looking through the api site, there doesn't seem to be any $node->terms property. There is a $node->taxonomy which is an array of term data - not something you can just print.

If you look at the default node template variables (http://api.drupal.org/api/function/template_preprocess_node/6), you can see there is a $taxonomy (which is an array of taxonomy link data generated from $node->taxonomy) and there is a $terms (which is the rendered HTML list of the data in $taxonomy).

Is there any reason you don't want to print $terms?

sleddoggin’s picture

Wow - that really passed by my mind for some reason. Thanks for the help. I got it all figured out finally.