Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
capellicI'm having the same issue.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedThis is true. AT this time panel-pane.tpl.php does not have suggestions.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedIf you want to use suggestions you have to create a preprocess and add the suggestions.
Comment #5
Headache CreditAttribution: Headache commentedCan'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:
and
without any luck - panels-pane-test.tpl.php is ignored at all.
Please point me what I'm doing wrong.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedDid you clear cache to make sure your preprocess is picked up?
Put a debug message in your preprocess to make sure it is run.
Comment #7
Headache CreditAttribution: Headache commentedYes, I did
drush cc all
and checked the function:
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.
Comment #8
Headache CreditAttribution: Headache commentedAny hints?
Comment #9
rhache CreditAttribution: rhache commentedPlease 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
Comment #10
Headache CreditAttribution: Headache commentedSorry, didn't notice the version of panels in first post.
Template suggestions work fine for panels-6.x
Comment #12
ice5nake CreditAttribution: ice5nake commentedAre 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.
Comment #13
aschiwi CreditAttribution: aschiwi commentedThere is a new module that makes using pane templates really easy: http://drupal.org/project/pps
Comment #14
rhache CreditAttribution: rhache commentedThe Clean Markup Module also makes the customization of panel region and panel pane wrappers very easy.
Comment #15
imalabyacreate a file panels-pane--node-title.tpl.php and do the necessary!!..
works fine!!.. :)