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 thoughts on “How to read and print body field value in drupal”

  1. 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!

Comments are closed.