David Lohmeyer's Blog

Drupal 7 Panels Template Suggestion Tips

If you're doing any theming with Drupal, you'll undoubtedly want to implement template suggestions for some of your fields at some point.  Usually you'll have some undesirable formatting, especially in Panels panes.  This post at Drupal.org has a method of how to find the appropriate template suggestion for your panel pane by working in your template.php file with the Devel module and dpm().

One gotcha would be with pane subtypes that have colons in them.  This can happen with tokens relatively often.  The answer is to substitute the colon with an underscore in the filename.  For instance, I was theming a token price with the pane type 'token' and pane subtype 'node:price'.  The correct template suggestion is 'panels-pane--token--node_price.tpl.php'.

Note that this technique with the colons only works after applying this patch with the 7.x-3.3 version of Panels!

Related Posts