I need to create a template file to theme a certain pane.
When i look at the theme_hook_suggestions, the 2nd suggestion would be perfect if I knew how to name the file. The suggestion is:
panels_pane__entity_field__node:field_overall_rating.
I got this far:
panel-pane--entity-field-[xxxx]tp.php
How do I finish the name?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | panels-fixed_colon_in_template_suggestions-1599374-5.patch | 888 bytes | caschbre |
| pane theming suggestions.png | 26.78 KB | nafmarcus |
Comments
Comment #1
merlinofchaos commentedThat's a bug in our code that isn't translating the : to an _ for the suggestion. You probably can't actually create a : in a suggestion name.
Comment #2
nafmarcus commentedSo for now, I should add my own template file name to the theme_hook_suggestions[] array? (& thanks for your time.)
Comment #3
merlinofchaos commentedYes that's a good workaround.
If you're up for it, it should be a simple patch to preg_replace or maybe even ctools_cleanstring.
Comment #4
caschbre commentedI came across this issue as well. It looks like the patch from #1178334: Automatically detect panel pane template suggestions by pane type is using strtr on string that has not been cleansed.
I'll see if I can create a patch for this.
Comment #5
caschbre commentedI've attached a patch that runs $content->type and $content->subtype through ctools_cleanstring before performing strtr. I looked at the new template suggestions and the colon is now replaced with a _.
What used to be:
panels_pane__entity_field__node:field_birthday
is now:
panels_pane__entity_field__node_field_birthday
Comment #6
merlinofchaos commentedThanks a ton! Committed and pushed.