I've created a couple of custom style plugins with render callbacks that exactly mimic those found in the 'naked' style plugin. However, any panel pane with the custom style applied to it does not get run through template_preprocess_panels_pane(). I'd still like all of the normal preprocessing to apply. Is this intentional?

Comments

grasmash’s picture

Status: Active » Fixed

Ah. If you define no render callbacks, the style will default to using template_preprocess_panels_pane() and its related family of functions.

grasmash’s picture

Correction, a render callback does need to be defined. Passing output directly to theme('panels_pane') does the trick.

/**
 * Implementation of hook_panels_style_info().
 */
function mymodule_gold_panels_styles() {
  return array(
    'title' => t('Gold Border'),
    'description' => t('Dispays the pane with a gold border.'),
    'render pane' => 'mymodule_gold_render_pane',
  );
}

/**
 * Render callback for "gold" panels pane style. Mimics default panel pane.
 */
function theme_mymodule_gold_render_pane($vars) {
  return theme('panels_pane', array('content' => $vars['content'], 'pane' => $vars['pane'], 'display' => $vars['display']));
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.