Currently is not possible control content of body/teaser using nodeapi. Only weak support via node_view() {node_invoke_nodeapi($node, 'view', $page)} is implemented. But it's not enough because node is not always rendered via node_view(). For example when listing nodes (/taxonomy/term), (/book), main page and more. If is rendered book.module print friendly page then is called directly book_content and no chance to change anything.

Of course, check_output() enables change everything via filter but rendered content it's cached (unless is switched off for whole filter group).

Suggest one would like to write module that will always change only small piece of content. For example:

  • prepare picture that will be displayed next to title (if exists)
  • add list of similar nodes that changes dynamically
  • append "Printed: "today's date" at the bottom line

BTW: Drawback of node_invoke_nodeapi() is that there is no control in what order are module hooks processed (in alphabet order). Maybe it worth implementing a api interface to enable forcing different order. But I have no idea how to do quickly and commonly

I think that new nodeapi hook should be implemented and invoked from node_prepare() that is called always.

function node_prepare($node, $teaser = FALSE) {
  $node->readmore = (strlen($node->teaser) < strlen($node->body));
  if ($teaser == FALSE) {
    $node->body = check_output($node->body, $node->format);
  }
  else {
    $node->teaser = check_output($node->teaser, $node->format);
  }
  node_invoke_nodeapi($node, 'prepare', $teaser);  // <------------ new hook
  return $node;
}

Tomas