Hi guys I'm looking at this:

http://api.drupal.org/api/HEAD/function/taxonomy_node_get_terms

I need to spit out a list of terms that are associated with a node.

I have the nid, so that's fine.

But what the heck is a $key = tid... whats all that about... it doesn't explain what these terms mean on the page or what kind of data type they are... what do I need to put there? I don't see any reason for another parameter other than nid....

Comments

danielb’s picture

I just put the first parameter in and it works fine without the second.. why don't they make it clear this is the case in the API?

Anonymous’s picture

danielb,

The definition in the API is read as such:

taxonomy_node_get_terms($node, $key = 'tid')

When you see something like $key = 'tid' in the arguments, it means that the default value of $key (that is if $key is not explicitly specified when you call the function) is 'tid'.

Hope it helps!