How to read and print body field value in drupal
While I browsed through several documentation, I come across users who ignorantly tried to display the code in the following way:
// $node->body;
// print $body;
// print $field-body[0]['view'];
// print $body->content['body']['#value'];
// print $content['body']['#value'];print $node->content['body']['#value'];
This last line contains the code that worked fine for me.
print $node->content['body']['#value'];

2 Comments










June 10th, 2009 at 12:42 pm
Exactly what I was looking for, thanks!
November 6th, 2009 at 9:35 am
Perfect! this is what I’ve been looking for hours. I wonder why they didn’t include this in the ConTemplate Tips.
Thank you very much for this!