node_build_content

Versions
5 – 6
node_build_content($node, $teaser = FALSE, $page = FALSE)
7
node_build_content(stdClass $node, $build_mode = 'full')

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

An structured array containing the individual elements of the node's body.

▾ 4 functions call node_build_content()

hook_search in developer/hooks/core.php
Define a custom search routine.
node_search in modules/node/node.module
Implementation of hook_search().
node_update_index in modules/node/node.module
Implementation of hook_update_index().
node_view in modules/node/node.module
Generate a display of the given node.

Code

modules/node/node.module, line 795

<?php
function node_build_content($node, $teaser = FALSE, $page = FALSE) {
  // Remove the delimiter (if any) that separates the teaser from the body.
  $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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.