Adding Custom Page Templates for Node Type

For Drupal 5

Adding the following to template.php allows files named page-nodetype.tpl.php to override the base page.tpl.php. This way, nodetypes can have their own design or blocks without relying on the general template.


function _phptemplate_variables($hook, $vars = array()) {

// Add additional template suggestions
  switch ($hook) {
    case 'page':  
      // Add page template suggestions based on node type, if we aren't editing the node.
      if ($vars['node'] && arg(2) != 'edit') {
        $vars['template_files'][] = 'page-'. $vars['node']->type;
      }
      break;
  }
 
  return $vars;
}

I've used this to limit the blocks or the menus appearing on a per nodetype basis.

Read More at Drupal.org