Style Drupal 7 log-in page

2020-05-27 04:36发布

问题:

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?

回答1:

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.