10

How do I style the login-page of Drupal 7? I used different methods like page-user-login.tpl or user-login.tpl of page-login.tpl but with no results.

Is there an easy way to theme your login page in Drupal 7 in his own .tpl-file?

Clive
  • 36,918
  • 8
  • 87
  • 113
Michiel
  • 7,855
  • 16
  • 61
  • 113

1 Answers1

22

You can override any page template by naming your templates in the following convention:

For page 'user/login':

page--user--login.tpl.php

For page 'foo/bar/'

page--foo--bar.tpl.php

See Core templates and About overriding themable output for more information.

Remember to clear Drupal's caches once you add a new template file so the theme registry has a chance to pick the new file up.

Clive
  • 36,918
  • 8
  • 87
  • 113
  • Got it, thanks!! A `page--user.tpl.php` is required though. And it's only working with `page--user--login.tpl.php`! But thanks! – Michiel Jan 03 '12 at 14:51
  • @Michiel: Sorry, I left out a dash, I've updated that in the answer. Check out [this link](http://drupal.org/node/1089656) as well it's the one I was originally looking for and explains all this very well – Clive Jan 03 '12 at 15:21
  • Thanks for the additional link – Michiel Jan 03 '12 at 16:00
  • @Clive Thank you so much for the gerat help. – Saeed Afzal Dec 20 '18 at 22:13