By dale386 on
I'm trying to convert a theme from Drupal 5 to Drupal 7. The theme is for a print magazine's website.
I have one CCK nodereference field that accepts multiple variables. The values link to contributor (author/photographer) nodes. In Drupal 5, I was able to display the values with this simple line:
<?php print $node->field_contributors['0']['view'] ?>
This would display the value (author's name) as a link to the node. This code no longer works in Drupal 7. I've dumped the $node variable with print_r and can see field_contributor, although I can't quite figure out how to output in the theme.
I've been working this for days to no avail. Please help me!
Thanks.
Comments
I havnt got to the theming
I havnt got to the theming stage in drupal 7 yet but from building nodes you need to assign a language. I imagine its the same on output.
try this.
$node->field_contributors[LANGUAGE_NONE]['0']['view']
or if doesnt know about language_none use 'und' instead
$node->field_contributors['und']['0']['view']