How do you override the default panels-pane.tpl.php file?

I am trying to use a different file for when Node: Title is selected from Panels.

I have tried the following:

panels-pane_node-title.tpl.php
panels-pane_panel_node_title.tpl.php
panels-pane-node-title.tpl.php
panels-pane-node_title.tpl.php

So I installed devel_themer which says there are no candidate files, is this true? Do I need to write a preprocess function to allow more templates like page.tpl.php and node.tpl.php?

Comments

capellic’s picture

I'm having the same issue.

merlinofchaos’s picture

This is true. AT this time panel-pane.tpl.php does not have suggestions.

merlinofchaos’s picture

Status: Active » Fixed

If you want to use suggestions you have to create a preprocess and add the suggestions.

Status: Fixed » Closed (fixed)

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

Headache’s picture

Status: Closed (fixed) » Active

Can't get suggestions to work.
MYTHEME dir contains default panels-pane.tpl.php and panels-pane-test.tpl.php with <?php print render($content); ?>

In template.php I tried both:

function MYTHEME_preprocess_panels_pane(&$vars) {
    $vars['theme_hook_suggestions'][] = 'panels-pane-test';
}

and

function MYTHEME_preprocess_panels_pane(&$vars) {
    $vars['template_files'][] = 'panels-pane-test';
}

without any luck - panels-pane-test.tpl.php is ignored at all.

Please point me what I'm doing wrong.

merlinofchaos’s picture

Did you clear cache to make sure your preprocess is picked up?

Put a debug message in your preprocess to make sure it is run.

Headache’s picture

Yes, I did drush cc all
and checked the function:

function MYTHEME_preprocess_panels_pane(&$vars) {
    $vars['theme_hook_suggestions'][] = 'panels-pane-test';
    drupal_set_message('Check: '.print_r($vars['theme_hook_suggestions'], 1));
}

drupal_set_message printed Array ( [0] => panels-pane-test ).

Tried the same on the fresh D7 installation and different theme - panels-pane-test.tpl.php still ignored.

Headache’s picture

Any hints?

rhache’s picture

Please note for anyone finding this issue that I've written a blog post that demonstrates how to create template overrides for panel panes in D6.

The problem in D7 is separate, and I've created a new issue here: #1178334: Automatically detect panel pane template suggestions by pane type

I would recommend closing this one.

Thanks,
Rene

Headache’s picture

Status: Active » Closed (fixed)

Sorry, didn't notice the version of panels in first post.
Template suggestions work fine for panels-6.x

ice5nake’s picture

Are template suggestions part of a sub-module? I can't get them to work. Preprocess function is running, adding to template_files, and template file is created. It's just not doing anything.

Any help would be appreciated.

aschiwi’s picture

There is a new module that makes using pane templates really easy: http://drupal.org/project/pps

rhache’s picture

The Clean Markup Module also makes the customization of panel region and panel pane wrappers very easy.

imalabya’s picture

create a file panels-pane--node-title.tpl.php and do the necessary!!..
works fine!!.. :)