Drupal 7 panel pane theming suggestions

October 17, 2011

I was working on a project and and I wanted to be able to update the panel pane template on a per pane basis. What I did was copy the panels-pane.tpl.php file from panels/templates in to my theme. I then added this to my template.php file.

function MYTHEME_preprocess_panels_pane(&$vars) {
// get the subtype
$subtype = $vars['pane']->subtype;

// Add the subtype to the panel theme suggestions list
$vars['theme_hook_suggestions'][] = 'panels_pane__'.$subtype;

return $vars;
}

This allows me to rename the panel template in this format panels-pane–SUBTYPE-NAME.tpl.php.

If you have any problems send me an email and I’ll try and help.