Hey

I'm trying to create a TPL file that affects the "Log into your account" page (.com/user) but does not affect the user/UID pages. . .

What can I do?

Thx

G

Comments

epicflux’s picture

Creating a page-user-login.tpl.php (for the path 'user/login') would do it, but I don't think it would be picked up if the user goes to the login screen with just 'user' in the path.

try the page-user-login.tpl.php to see if that works for both if not:

Try following these directions for creating custom page template suggestions to accomplish what you want.

Setup your code so it checks the url for the 'user' or 'user/login' path,

if (arg(0) == 'user' && (!arg(1) || (arg(1) == 'login')) {
  $vars['template_files'][] = 'page-user-login';
}

I didn't test the above code, and I think you could just check for no second argument since the system should add the template for the user/login page.

gtothab’s picture

The're was a typo in the code giving me a parse error but after fixing it, it worked like a charm. Thanks a bunch for the help!

Here's the correct code for anyone interested:

if (arg(0) == 'user' && (!arg(1)) || arg(1) == 'login') {
  $variables['template_files'][] = 'page-user-login';
}