Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ncordell on
I've searched the forums and googles, but can't seem to find the drupal 7 equivalent of the drupal 6 user-login.tpl.php. I tried user--login.tpl.php to no avail. How do I theme the login page?
Comments
Did you found this out? I've
Have you found this out? I've had user-login.tpl.php in Drupal 6, and it's still working in Drupal 7, but the form itself is not showing up.
Same issue here
I tried many drupal 6 tutorials for custom login ... but drupal_render($form) gives a blank page everytime. Please help.
Did you register with hook_theme?
Drupal won't find those files if you don't register them in a hook_theme() function:
For more on this function see the API documentation.
To theme the pages, I had to use a total hack because I couldn't get D7 to see my template suggestions. This is NOT the way to do it but until I have more time to sleuth this in D7 it will have to do the job. I put it at the very top of page.tpl.php.
Another way
Here is the way I usually go with:
Step 1, register user-login.tpl.php in template.php like so (where hook is the name of your theme):
Next, create a preprocess function that will let you modify the available variables from the output of the user module. This goes in your template.php file anywhere below the above function:
Now, create your user-login.tpl.php page in your theme folder. Simply put the following code at the top:
Clear your cache. On your next visit to /user/login you should see the array dumped out.
medenfield - I've done this
medenfield - I've done this and variables look good. Now I try to actually render the form in user-login.tpl.php:
print drupal_render($variables['form']);
and this gives me white screen and "out of memory" error. Is there anything I'm missing here?
I have the same issue WSOD
I have the same issue WSOD when rendering form.
Any solution?
Fixing the WSOD
This is for future comers benefit. You can find the proper procedure start to finish for drupal 7 here at this drupal node: http://drupal.org/node/350634
The key thing I think was this:
<?php print drupal_render_children($form) ?>
From a future comer...
Thank you!!!
Inline simple login
Fairly straight forward solution:
http://www.victheme.com/blog/drupal-7-creating-horizontal-login-bar-with...
Both functions go into template.php while
print login_bar ();
works in page.tpl.php.Hopefully will stop you having to try various more complex methods.