Trying to get Drupal 6 to have page-whatever.tpl.php affect content type "Whatever"? It's a head ache isn't it? Well the solution is simple! Add this to your template.php
function _phptemplate_variables($hook, $vars) {
if ($hook == 'page' && isset($vars['node'])) {
$vars['template_files'][] = 'page-'. str_replace('_', '-', $vars['node']->type);
}
return $vars;
}
Viola! It works and it's that darn simple!
Post new comment