Young Hahn Proposes A Rule-Based Drupal Theme Layer
While there were many great presentations at DrupalCon DC, Young Hahn's Limitations of the Drupal Theme Layer was the only one that blew me away. Most of the session attendees and readers of the related blog post seem to miss his main point; a proposal for a rule-based theme layer.
Rule-based theming versus-command based theming is difficult to understand – possibly more so if you are already familiar with Drupal's current theme layer. One way to understand it better might be to think of it as a language & system that would allow you to use selector, perhaps like a CSS selector, to define the Drupal objects which some theme modifications are applied to. For example, something along the lines of
might allow you to override the markup of titles of article nodes. This is not a great example since this code is not and probably never will be machine-interpretable. However it demonstrates the use of a rule-based selector applied it to Drupal objects to modify the rendered markup, instead of an element's style. This, I believe, illustrates the still-hypothetical theme layer Young Hahn proposes.
Rule-based theming is somewhat achievable with XML+XSLT, though not in Drupal – yet. There is an argument that XSLT is too difficult for designers or themers to use. I agree with Hahn's argument that it reuses all the same concepts that these people know from HTML, CSS and Drupal themable hooks. There are no new concepts to learn, just how they're applied. Therefore should not be difficult to learn.
Further, technology changes. If it didn't it would be technology. As web builders it's our responsibility to direct this change in some areas and keep up with it in others. Most importantly, the extravagant advantages of a rule based theme layer are clear, at least to me, and well documented on Hahn's blog post on the topic (Skip straight to "Historical interlude: Remember 1997?").
What to Drupal core developers think of this change? What do Drupal contrib module developers and Drupal website developers think? What about themers? Designers? Let's have a conversation.
node.article title {
<h2><span class="title-inner">$title</span></h2>
}



















Comments
Problem with theming sessions
I'll second that
cool but bleh
Thanks Bevan for blogging