Define variables for template files I am trying to move the first chunk of code including the PHP logo call, and the breadcrumbs into the header region. I have created the block, and made it capable of reading PHP. I understand I need to write a preprocess function in template.php, but I am not sure how this is done. I am working in Drupal 7.

Can anyone show me an example, and explain how this works, or point me in the right direction?
Defining a variable in a template_preprocess() function is straightforward:

/**
* Implements hook_preprocess().
*/
function yourthemename_preprocess(&amp;$variables, $hook) {

    $variables['your_variable_name'] = "some value";

}


In your template file, you would just output it directly, for example using the following code:

&lt;?php print $your_variable_name; ?&gt;


I'm not sure this answers your real question, but I could use a little more information. Why are you trying to move the logo/breadcrumbs using a preprocess function? Which theme are you using? If you're moving these around, it is usually easier to just edit the page.tpl.php file in your theme, and work with them from there.