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.
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.