Drupal's theme layer

UPDATED: Can't Add CSS, JS, RSS Icon Or Set Title Or Messages In Preprocess Page?

UPDATE: Due to recent changes to our website the code snippet (the valuable part of this blog post) got accidentally lost. If you read this already, please come back to see the sample code. Thanks!

Often you want to add CSS files, scripts, feed icons or even set Drupal's page title from the theme layer. The most obvious place to call Drupal's functions for these tasks is probably in a page preprocess function. However calling the following Drupal API functions from a theme or module's NAME_preprocess_page() function often doesn't work;

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