Howdy,

I've found several posts on this topic but they weren't quite the solution I needed :)

I want to provide a different page template whenever someone logs in, so I created a template file called *page-admin.tpl.php*. It works a treat on the pages that */admin* in the URL (I know this is the way its supposed to work), but I also need it to appear in all other pages that a logged-in user can access.

Creating additional templates just won't do :(

There's a bit of php script that I found on lullabot but it makes the page disappear.

Did I mention that I don't know how to PHP?

Thanks and cheers!

Comments

ArgentOfChange’s picture

Thanks to a pal of mine - I'm posting it here:

function _phptemplate_variables($hook, $vars = array()) {
switch ($hook) {
case 'page':
global $user;
if ($user->uid > 0) {
$vars['template_file'] = 'page-admin';
}
break;
}
return $vars;
}

"Half Iago, half Fu Man Chu - all bastard!"