In my Drupal custom parent theme, I have included a file called panels-pane.tpl.php
.
This is the main panel pane template. By including this tpl file in my theme, I can override the one in the Panels module folder, which allows me to control its mark-up.
It all works fine. However, when I enable a sub theme that is based on the parent theme, this particular file is ignored. All the other files are inherited.
How can I get this file to be inherited as well?
Would it be possible to force this to be always loaded regardless of the theme?
Please note: I am talking about overriding the panels-pane.tpl.php
that comes from the original Panels module. I am not talking about creating a custom Panels layout.
Steps I have tried:
- Copying the
panels-pane.tpl.php
into the sub themes template directory. - Clearing the caches
- Uninstalling and then re-enable the parent and sub themes
UPDATED
Panels has a file called panels.module
. In it has a function called panels_theme()
, which contains the following:
$theme['panels_pane'] = array(
'variables' => array('output' => array(), 'pane' => array(), 'display' => array()),
'path' => drupal_get_path('module', 'panels') . '/templates',
'template' => 'panels-pane',
);
Can I use this to control panels-pane.tpl.php
from inside a module by using theme_registry_alter?
I have tried the following code, but it doesn't work:
function legendary_theme_registry_alter(&$theme_registry) {
$theme['panels_pane'] = array(
'variables' => array('output' => array(), 'pane' => array(), 'display' => array()),
'path' => drupal_get_path('theme', 'legendary') . '/templates',
'template' => 'panels-pane',
);
}