You are here

function panels_print_layout in Panels 7.3

Same name and namespace in other branches
  1. 8.3 panels.module \panels_print_layout()
  2. 5.2 panels.module \panels_print_layout()
  3. 5 panels.module \panels_print_layout()
  4. 6.3 panels.module \panels_print_layout()
  5. 6.2 panels.module \panels_print_layout()

For external use: Given a layout ID and $content array, return panel display.

The content array is filled in based upon the content available in the layout. If it's a two column with a content array defined like. @code array( 'left' => t('Left side'), 'right' => t('Right side') ),

Then the $content array should be @code array( 'left' => $output_left, 'right' => $output_right, )

The output within each panel region can be either a single rendered HTML string or an array of rendered HTML strings as though they were panes. They will simply be concatenated together without separators.

1 call to panels_print_layout()
panels_views_plugin_row_fields::render in plugins/views/panels_views_plugin_row_fields.inc
Render a row object. This usually passes through to a theme template of some form, but not always.

File

./panels.module, line 2030
Core functionality for the Panels engine.

Code

function panels_print_layout($layout, $content, $meta = 'standard') {
  ctools_include('plugins', 'panels');

  // Create a temporary display for this.
  $display = panels_new_display();
  $display->layout = is_array($layout) ? $layout['name'] : $layout;
  $display->content = $content;

  // Get our simple renderer.
  $renderer = panels_get_renderer_handler('simple', $display);
  $renderer->meta_location = $meta;
  return $renderer
    ->render();
}