Getting the content type in Template.php I am trying to get the content type to conditionally add JavaScript code/files to the template.

The code in template.php is the following one:

echo $node-&gt;type;


The same line in "node.tpl.php" is returning the content type. How do I get it to work
in template.php?
You can put hook_preprocess_node() in your template.php.

function THEMENAME_preprocess_node(&amp;$variables) {
  $node = $variables['node'];
  if ($node-&gt;type == 'your_type') {
    //Add the JavaScript file.
    drupal_add_js('/path/to/jsfile.js')
  }
}