8.5.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.0.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.1.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.2.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.3.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.4.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
8.6.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL)
7.x node.module node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL)

Constructs a drupal_render() style array from an array of loaded nodes.


$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 modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of all users.
blog_page_user in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of a given user.
node_page_default in modules/node/node.module
Menu callback: Generates a listing of promoted nodes.
node_show in modules/node/node.module
Generates an array which displays a node detail page.
taxonomy_term_page in modules/taxonomy/taxonomy.pages.inc
Menu callback; displays all nodes associated with a term.


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


function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
  $build = array();
  $entities_by_view_mode = entity_view_mode_prepare('node', $nodes, $view_mode, $langcode);
  foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
    field_attach_prepare_view('node', $entities, $entity_view_mode, $langcode);
    entity_prepare_view('node', $entities, $langcode);
    foreach ($entities as $entity) {
      $build['nodes'][$entity->nid] = node_view($entity, $entity_view_mode, $langcode);
  foreach ($nodes as $node) {
    $build['nodes'][$node->nid]['#weight'] = $weight;

  // Sort here, to preserve the input order of the entities that were passed to
  // this function.
  uasort($build['nodes'], 'element_sort');
  $build['nodes']['#sorted'] = TRUE;
  return $build;


joshiparthin’s picture

Is it possible to format data in table format using this api function, instead of teaser or pager... ?

skruf’s picture

The function returns a render array so yes you can add '#theme' => 'table' at the top level of the array. Just make sure you also add the other parameters that the theme function requires.

Good explanation of render arrays: https://drupal.org/node/930760

skruf’s picture

So you could render the return value as a table but you can't use this function directly to do it.