You are here

function panelizer_panelizer_task_render in Panelizer 7

Same name and namespace in other branches
  1. 6 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_render()
  2. 7.3 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_render()
  3. 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 69
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 (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);
}