The contruction in Computed Code: $node->taxonomy does not render taxonomy data.
The same code renders data when placed in node.tpl.php

I succeeded to get the taxonomy data by accessing the database (taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid')),

Is it also possible to get taxonomy data by using the array construction??

Comments

nicholas.alipaz’s picture

I too had this issue, thanks to bleeuwen I was able to figure out what was going on. I thought I was going crazy!

I did this to display the taxonomy where I wanted it:

$tags = taxonomy_node_get_terms_by_vocabulary($node, '4', $key = 'tid'); // Get my chosen vocabulary (4)
$node_field[0]['value'] = '';
foreach ($tags as $key => $value) {
  $node_field[0]['value'] .= '<a href="'.$value->description.'" title="'.$value->name.'">'.$value->name.'</a><br />';
  $i++;
}

I hope someone else gets some use out of that. BTW, I agree the terms should be accessible by computed fields.

bleeuwen’s picture

Status: Active » Closed (fixed)