You are here

function panels_render_display in Panels 8.3

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

Render a display by loading the content into an appropriate array and then passing through to panels_render_layout.

if $incoming_content is NULL, default content will be applied. Use an empty string to indicate no content.

Related topics

File

./panels.module, line 846
panels.module

Code

function panels_render_display(&$display, $renderer = NULL) {
  ctools_include('plugins', 'panels');
  ctools_include('context');
  if (!empty($display->context)) {
    if ($form_context = ctools_context_get_form($display->context)) {
      $form_context->form['#theme'] = 'panels_render_display_form';
      if (empty($form_context->form['#theme_wrappers']) || !in_array('form', $form_context->form['#theme_wrappers'])) {
        $form_context['#theme_wrappers'][] = 'form';
      }
      $form_context->form['#display'] =& $display;
      return $form_context->form;
    }
  }
  return $display
    ->render($renderer);
}