Phptemplate passes on the full $node variable to allow more flexibility, but if you are in a taxonomy/term view, the $node->body is unavailable, only $content which in that case is the teaser. I could fetch the full node node.within node.tpl.php but this would be inefficient. Any idea why the body is not there?

Comments

gerd riesselmann’s picture

Generally, when a node reaches the template engines it has either a body or a teaser, but never both. This policy is given by the node module itself.

See function node_view(), in node.module around line 541 you find:

  // unset unused $node part so that a bad theme can not open a security hole
  if ($teaser) {
    unset($node->body);
  }
  else {
    unset($node->teaser);
  }

This code removes either the body or the teaser from the node, depending on if it appears as single page or within a list of other nodes.

If you want both teaser and body, simply comment out the code above.

------------------
Gerd Riesselmann
www.gerd-riesselmann.net

masood_mj’s picture

Thank you
but, is not there a better solution to not change node.module? because it may be replaced if we update the drupal!