function panelizer_panelizer_task_render in Panelizer 6
Same name and namespace in other branches
- 7.3 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_render()
- 7 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_render()
- 7.2 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_render()
Render a node that has been panelized.
1 string reference to 'panelizer_panelizer_task_render'
- panelizer_node.inc in plugins/
task_handlers/ panelizer_node.inc - This is the task handler plugin to handle node_view.
File
- plugins/
task_handlers/ panelizer_node.inc, line 70 - This is the task handler plugin to handle node_view.
Code
function panelizer_panelizer_task_render($handler, $base_contexts, $args, $test = TRUE) {
// The node this is for should always be the first context available. If
// this is not a node, bail. This should allow us to be used on things
// that aren't node_view if, for some weird reason, people want to.
if (empty($base_contexts)) {
return;
}
$context = reset($base_contexts);
if ($context->type != 'node' || empty($context->data)) {
return;
}
// Extract the node from the context so we can load the panelizer.
$node =& $context->data;
// Load the panelizer and render the display.
ctools_include('node', 'panelizer');
return panelizer_render_node($node, $args);
}