function nodequeue_view_nodes in Nodequeue 7.2
Same name and namespace in other branches
- 6.2 nodequeue.module \nodequeue_view_nodes()
- 7.3 nodequeue.module \nodequeue_view_nodes()
Get node_view output from a nodequeue.
Parameters
integer $sqid: Subqueue ID
boolean $backward: If TRUE (default), display the node with the highest queue position first.
$view_mode: View mode, e.g. 'full', 'teaser'... For backward compatibility, non-string arguments will be converted to boolean, TRUE implies 'teaser' and FALSE implies 'full'.
boolean $links: Deprecated.
integer $from: Display offset from highest (if $backward is FALSE, lowest) queue position.
integer $count: Maximum number of nodes to display.
Return value
array An array as expected by drupal_render().
2 calls to nodequeue_view_nodes()
- NodequeueExternalFetchingUnitTest::testNodequeueViewNodes in tests/
nodequeue.test - nodequeue_view_random_node in ./
nodequeue.module - View a random node from a queue.
File
- ./
nodequeue.module, line 1964 - Maintains queues of nodes in arbitrary order.
Code
function nodequeue_view_nodes($sqid, $backward = TRUE, $view_mode = 'teaser', $links = TRUE, $from = 0, $count = 0) {
// This is for backward compatibility with 'D6 style' argument, which used
// to be $teaser = TRUE (and previously wasn't converted as necessary in D7
// version):
if (!is_string($view_mode)) {
$view_mode = $view_mode ? 'teaser' : 'full';
}
$nodes = nodequeue_load_nodes($sqid, $backward, $from, $count);
$output = node_view_multiple($nodes, $view_mode);
// Keep backward compatibility with the previous version of this function, which
// returned an array of individually built nodes.
// @todo reevaluate this.
unset($output['nodes']['#sorted']);
return array_values($output['nodes']);
}