node_build

Versions
7
node_build($node, $build_mode = 'full')

Generate an array for rendering the given node.

Parameters

$node A node object.

$build_mode Build mode, e.g. 'full', 'teaser'...

Return value

An array as expected by drupal_render().

▾ 9 functions call node_build()

book_node_export in modules/book/book.module
Generates printer-friendly HTML for a node.
comment_preview in modules/comment/comment.module
Generate a comment preview.
comment_reply in modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
node_build_multiple in modules/node/node.module
Construct a drupal_render() style array from an array of loaded nodes.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.
node_search_execute in modules/node/node.module
Implement hook_search_execute().
node_unpublish_by_keyword_action in modules/node/node.module
Implement a configurable Drupal action. Unpublish a node if it contains a certain string.
theme_node_preview in modules/node/node.pages.inc
Display a node preview for display during node creation and editing.
_node_index_node in modules/node/node.module
Index a single node.

Code

modules/node/node.module, line 1151

<?php
function node_build($node, $build_mode = 'full') {
  // Populate $node->content with a render() array.
  node_build_content($node, $build_mode);

  $build = $node->content;
  // We don't need duplicate rendering info in node->content.
  unset($node->content);

  $build += array(
    '#theme' => 'node',
    '#node' => $node,
    '#build_mode' => $build_mode,
  );
  // Add contextual links for this node.
  // @todo Make this configurable per build mode.
  $build['#contextual_links']['node'] = array('node', array($node->nid));

  // Allow modules to modify the structured node.
  drupal_alter('node_build', $build);

  return $build;
}
?>
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.