Adding variables to page--taxonomy.tpl.php How do I add preprocess variables to page--taxonomy.tpl.php which will be available only to the vocabulary Project Type? I know my code below is wrong.

function themename_preprocess_taxonomy(&amp;$vars, $hook){
    $vars['testing'] = 'It works!'; // This doesn't work :p

    // If that checks out, how to limit it only to a specific vocabulary (e.g. Shoes)?
}
You can limit variables to certain conditions. Obviously only when the variables to measure these conditions are available.

function themename_preprocess_taxonomy(&amp;$vars, $hook){
  var_dump($vars);
}


This will show you all the available variables, for example the $vid, which contains the vocabulary-ID. The simple version would be:

function themename_preprocess_taxonomy(&amp;$vars, $hook){
  if($vars['vid'] == 12) {
    $vars['example'] = "Foo";
  }
}


A clean, and much better solution would then be:

function themename_preprocess_taxonomy(&amp;$vars, $hook){
  $vars['example'] = ''; # Always instantiate a variable, and make sure
                          # it has a constant type 
                          # e.g. always return a string.
  if($vars['vid'] == variable_get('themename_vid_for_example', 123)) { # Avoid Magic Numbers [1]
    $vars['example'] = "Foo";
  }
}


[1] http://en.wikipedia.org/wiki/Magic_number_%28programming%29#Unnamed_numerical_constants

EDIT: updated variable_get. tss.