A modular approach to Drupal theming: part 2
We recently discussed how we feel Drupal doesn't currently provide site administrators many tools to get in and leverage the powerful "backend" API's that Drupal provides to theme developers.
Live Themer is our answer to that question. At present it specifically exposes the following theme API concepts in a user friendly way:
- theme hook suggestions: Drupal theme developers often find themselves telling Drupal to switch to a different themed representation for a certain element in certain cases. For example, they might theme a node comment differently if the node author wrote it, or they might use a special node layout if the node type is “product”.
-
themable object properties: theme developers often access the properties of a themable object and respond to them in different ways. For example, the block object contains information such as the module which created it, the block ID, the block subject and so forth. As a couple of examples then, themers often do something special for all blocks created by the User module, or they might add some special CSS for all links (
<a>tags) when the links appear the footer region.
Live themer allows the site builder to do exactly these types of things and more, but without having to write a single line of PHP or custom CSS.
It does this through “variations”, which are essentially each a folder containing various bits of theme code. Variations are self-contained and distributable. A variation contains a .info file (in this case named .variation), and any combination of a template.tpl.php, css file(s), javascript file(s) and a form include, which defines (using FAPI) a settings form to allow the user to customise the variables sent into the tpl.php, and any css customisation that is appropriate to that specific variation.
Variations can be built quickly thanks to the powerful API we’ve put together, and we hope over time the Drupal community will grab hold of the idea of variations and create and share loads of them!
Live Themer also provides “scopes” which target one or more objects of a specific type, and allows the user to apply variations to just those objects. For example, a scope such as “Blocks from this module” will highlight all the blocks which were created by a certain module. If you click the “recent users” block, and choose this scope, all other blocks created by the user module will be highlighted, after which you can apply variations to just those blocks.
Using these fundamental concepts, we believe Live Themer manages to open up a lot more of the theming power that Drupal programmers love, placing that power straight into the hands of the site administrators.

Comments
It sound great, but why don't
05 Aug 2011
19:47
It sound great, but why don't you release a preview version for all of us to try? i suppose it would be a priority to keep up interest?
Add new comment