function node_build_content

7.x node.module node_build_content($node, $view_mode = 'full', $langcode = NULL)
6.x node.module node_build_content($node, $teaser = FALSE, $page = FALSE)

Builds a structured array representing the node's content.

Parameters

$node: A node object.

$teaser: Whether to display the teaser only, as on the main page.

$page: Whether the node is being displayed by itself as a page.

Return value

A node object with its content property set to a structured array containing the individual elements of the node's body.

5 calls to node_build_content()
book_node_export in drupal-6.x/modules/book/book.module
Generates printer-friendly HTML for a node.
hook_search in documentation-6.x/developer/hooks/core.php
Define a custom search routine.
node_search in drupal-6.x/modules/node/node.module
Implementation of hook_search().
node_view in drupal-6.x/modules/node/node.module
Generate a display of the given node.
_node_index_node in drupal-6.x/modules/node/node.module
Index a single node.

File

drupal-6.x/modules/node/node.module, line 1082
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_build_content($node, $teaser = FALSE, $page = FALSE) {

  // The build mode identifies the target for which the node is built.
  if (!isset($node->build_mode)) {
    $node->build_mode = NODE_BUILD_NORMAL;
  }

  // Remove the delimiter (if any) that separates the teaser from the body.
  $node->body = isset($node->body) ? str_replace('<!--break-->', '', $node->body) : '';

  // The 'view' hook can be implemented to overwrite the default function
  // to display nodes.
  if (node_hook($node, 'view')) {
    $node = node_invoke($node, 'view', $teaser, $page);
  }
  else {
    $node = node_prepare($node, $teaser);
  }

  // Allow modules to make their own additions to the node.
  node_invoke_nodeapi($node, 'view', $teaser, $page);

  return $node;
}