Okay. I'm trying to make my site use different page-whatever.tpl.php files depending on which section of the site the user is at. I've seen various examples in the forums and handbooks (separate admin theme, separate front page theme, etc.) but I've yet to see an example of someone trying to use multiple page templates.
Below is the code I'm using in my template.php in order to switch templates (I'm not a coder and my php skills are VERY limited, so bear with me here...the code is cobbled together from several example snippets):
function _phptemplate_variables($hook, $vars = array()) {
switch ($hook) {
case 'page':
global $user;
if ($vars['is_front']) {
$vars['template_file'] = 'page-index';
}
elseif ((arg(0) == 'admin')) {
$vars['template_file'] = 'page-admin';
}
elseif ((arg(0) == 'group')) {
$vars['template_file'] = 'page-group';
}
elseif ((arg(0) == 'add')) {
$vars['template_file'] = 'page-addnode';
}
break;
}
return $vars;
}
The front page renders correctly (using the correct template) but the rest simply default back to page.tpl.php. What am I doing wrong?
FYI, the drupal version is HEAD from a few weeks ago and I'm using clean urls and pathauto and some manual url aliases to deal with urls.
Any help would be greatly appreciated. Thanks in advance.