I needed a simple method to render a single field from a node object in Drupal 7, but couldn't find any good answers by searching the web.
Here is the solution I finally came to by searching the documentation:
// Render the field named "field_image" $field = field_view_value('node', $node, 'field_image', $node->field_image[$node->language][0]); print render($field);



Comments
Thanks!!! After trying
Thanks!!!
After trying numerous examples on other forums to no avail, your example above finally worked :-)
Post new comment