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().
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 