In a bid to separate logic from presentation, Drupal's theming system tries to minimize the amount of PHP that is necessary in a template file. This ensures that themers who are not as comfortable in a PHP environment, are not exposed to the nitty-gritty of complicated code manipulations. Instead, they are provided with a host of pre-prepared variables that contain the content of the regions and blocks that make up a page, or those that describe other elements such as user details and submission information that can be utilized in the template file.
But the question arises: where do these variables come from? And how can they be modified? This is where preprocess and process functions come in. Prior to the execution of every template file, Drupal calls a set of functions known as preprocess functions that insert, modify, and in general, organize the variables (provided by Drupal, its modules, and the theming system), which are available for use in the file. Furthermore, as we...