I'd like to make a suggestion for a new module, that makes it easier to create template/theme overrides, without having to manually create syntactically correct .tpl filenames and content.
The problem
As I understand it (which may be wrong!), Drupal has a very clever and sophisticated method to override nearly all output, "through a series of cascading templates". The Content Construction Kit (CCK) lets me define how data is entered, Views lets me define how tables and lists of data are displayed, but there is little that lets non-developers describe how contents is displayed for output. Developers must resort to creating new templates if they want to output nodes, blocks, and fields in new ways. Views is not designed for, and should not be used to override notes.
The solution
By way of an example, I have a new content type in which fields are entered in a particular order. But I want to both output the fields in a different order, and re-write some of the fields. A developer would create a new template called node-mycontentype.tpl.php, and a new template for rewriting my field, the name of which I have no even been able to work out! I envisage these features:
- An option for specified users roles to display an "override template" button for all contents types, blocks, and other overridable content (eg. breadcrumbs, search form, etc)
- When selected, the override to allow optional selection of, for example, ALL blocks, specify blocks, other groups of blocks, etc. (likewise nodes by content type, etc)
- The automatic creation of the appropriate overriding new template file, eg. node-mycontentype.tpl.php
- For development purposes, the option to be able to enable/disable, delete/rename the specified overriding new template file.
- The option to be able to text edit the specified overriding new template file.
- The option to show a WYSIWYG-like version of the new template, showing field areas, that can be edited by drag-and-drop... a bit like Admin/blocks lets you drag blocks to new regions.
- The option to select individual fields from a template, and override them too
- The option to provide conditional display of individual fields (a bit like views), eg. display field if non-empty, rewrite field (cf Views), etc, so that the novice does not need to hand-code.
Rationale
I think this will open up content output theming to non-developers, especially where admins do not have access to a server, and can not create their own .tpl files.
Comments
Possible solution
The Display Suite may be a step towards this.
Update 3 Aug 2010: This does pretty much as wanted.