NodeOne

Learn Drupal 14g: Preprocessing 2

by NodeOne

This screencast is a part of the epic learning series "Four weeks of Drupal", chapter "Introduction to theming". You can view the full series at dev.nodeone.se/en/four-weeks-of-drupal
Please post any comments over there, or we won't see them. Sorry.

This screencast shows some more useful things with preprocess functions:
* How to add a new CSS class in a preprocess function.
* That you can call drupal_add_css and drupal_add_js to load new CSS or JS files.
* There is a general hook_preprocess, called for *all* template files. Use with care.
* There is a hook_process_HOOK being called after the preprocess functions, usually to do things like flatten arrays and other data provided by preprocess hooks.
* Again: You should be aware of what kind of data you're working with in preprocess functions. (User names, for example, may contain spaces!)