Ability for modules to suggest tpl.php templates.
| Project: | Custom Page |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | irakli |
| Status: | active |
Jump to:
One of the core intents for the creation of CustomPage module was always the desire to allow more modularity of theming. Specifically: ability for modules to provide initial/default HTML template that can be overridden in a theme.
Currently this can be achieved, in a module by implementing a theming function. It seems like this is increasingly unpopular way of generating HTML in Drupal (e.g. Views highly emphasizes tpl.php support for View theming and only supports theme functions nominally). It's so for a good reason: theme function is a PHP code and PHP code directly generating HTML with "echo" functions is a clear anti-pattern.
I think we should create a way for modules to provide initial template with a tpl.php in a module folder. Those can be overridden by tpl.php implementations in a theme folder, if/when needed.
This improvement will probably greatly improve modularity and packaging of Custompage.

#1
I think this is a great idea. Maybe for those modules that provide custompages via the hook custompage can register a theme tpl file for that module if it exists on the filesystem? Is that along the lines of what you were thinking?