You are here

function node_example_view in Examples for Developers 6

Implementation of hook_view().

This is a typical implementation that simply runs the node text through the output filters.

Related topics

File

node_example/node_example.module, line 275
This is an example outlining how a module can be used to define a new node type.

Code

function node_example_view($node, $teaser = FALSE, $page = FALSE) {
  $node = node_prepare($node, $teaser);
  $node->content['myfield'] = array(
    '#value' => theme('node_example_order_info', $node),
    '#weight' => 1,
  );
  return $node;
}