Insert this code into template.php
function phptemplate_preprocess_page(&$vars) {
// are we on a page that displays ONE node?
if (arg(0) == 'node' && is_numeric(arg(1))){
// Then let's get the node object
$node = node_load(arg(1));
$suggestions[] = 'page-'.$node->type;
$vars['template_files'] = $suggestions;
}
}In my case I created a content type called 'hub' and then a page-hub.tpl.php adapted from the standard page template (don't forget to clear the cache via admin/settings/performance, or you wont see a change). Don't forget to add in something like this into the head section of your new template, so you can style it separately
<link type="text/css" href="<?php print base_path() . path_to_theme() ?>/page-hub.css" rel="stylesheet"/>further reading:
http://drupal.org/node/249726


Add new comment