function node_view_multiple
Constructs a drupal_render() style array from an array of loaded nodes.
Parameters
$nodes: An array of nodes as returned by node_load_multiple().
$view_mode: View mode, e.g. 'full', 'teaser'...
$weight: An integer representing the weight of the first node in the list.
$langcode: (optional) A language code to use for rendering. Defaults to NULL which is the global content language of the current request.
Return value
An array in the format expected by drupal_render().
5 calls to node_view_multiple()
- blog_page_last in drupal-7.x/
modules/ blog/ blog.pages.inc - Menu callback; displays a Drupal page containing recent blog entries of all users.
- blog_page_user in drupal-7.x/
modules/ blog/ blog.pages.inc - Menu callback; displays a Drupal page containing recent blog entries of a given user.
- node_page_default in drupal-7.x/
modules/ node/ node.module - Menu callback: Generates a listing of promoted nodes.
- node_show in drupal-7.x/
modules/ node/ node.module - Generates an array which displays a node detail page.
- taxonomy_term_page in drupal-7.x/
modules/ taxonomy/ taxonomy.pages.inc - Menu callback; displays all nodes associated with a term.
Archivo
- drupal-7.x/
modules/ node/ node.module, line 2668 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Código
function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
field_attach_prepare_view('node', $nodes, $view_mode, $langcode);
entity_prepare_view('node', $nodes, $langcode);
$build = array();
foreach ($nodes as $node) {
$build['nodes'][$node->nid] = node_view($node, $view_mode, $langcode);
$build['nodes'][$node->nid]['#weight'] = $weight;
$weight++;
}
$build['nodes']['#sorted'] = TRUE;
return $build;
}