Closed (fixed)
Project:
Documentation
Component:
Correction/Clarification
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
12 Feb 2008 at 10:46 UTC
Updated:
16 Feb 2012 at 21:53 UTC
Since in Drupal 6, the _phptemplate_callback() function is no longer supported, the code snippets on the 'Customising the login form' page at http://drupal.org/node/19855 doesn't work for Drupal 6.
I did some investigating in the new theming changes and came up with a snippet which does work for Drupal 6.
For Step 1 of 2, mentioned on the page, the code which should be added to template.php for Drupal 6.x is :
/**
* This snippet will register a theme implementation of the user login form.
*
* Drupal 6.x only!
* Replace 'mytheme' with the name of your theme.
*/
function mytheme_theme() {
return array(
'user_login' => array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
),
);
}
/**
* Theme implementation of the user login form.
*
* Drupal 6.x only!
* Replace 'mytheme' with the name of your theme.
*/
function mytheme_user_login($form) {
return drupal_render($form);
}
For Step 2 of 2 mentioned on the page, the procedure for Drupal 6.x is exactly the same as for Drupal 5.x.
Hope this helps a bit.
Comments
Comment #1
gdevlugt commentedI did some further testing and the code (second function) :
isn't needed. It was a leftover from some testing. Sorry for the confusion.
Comment #2
dreado commentedI can't get this to work, the extra text does not appear. Any idea where I might be going wrong?
Should
user-loginbeuser_loginbtw? I've tried it both ways, still doesn't work.Comment #3
dreado commented... does this only work for the dedicated login page per chance?
Comment #4
gdevlugt commentedHi,
You could try to add the following code to the top of your page.tpl.php file :
This will clear out any theme cache left overs preventing things to show up.
The code applies to the dedicated login page.
Comment #5
nikkiana commentedWorking on this at DrupalCon.
nikkiana
knitgeeklife.com
Comment #6
secretz commentedwill let you change the small login box. And yes, if you use Drupal 5's step 2, you will need to change template's value from 'user-login' to 'user_login'.
Thanks for this, I was struggling with it until now.
Comment #7
revlimiter commentedWondering how to modify my Drupal 6.2 Login Form...
I would like to add custom CSS classes to the input fields, add small images above the username and password input fields, and remove the "Username: *" and "Password: *" text.
Any help is greatly appreciated!
Thanks! :)
Comment #8
waldmeister commentedHi!
Ther is a great way to modify internal forms. This puts out a small login form in my header:
I am getting the whole document from drupal and modifying some ugly values.
To see the array and all values, uncomment the
print_rThis login Form is always displayed. make your own "User bar" as described here: http://drupal.org/node/92657
Is there an so-called CSS-Guru out there, who can help me out with theming of this?
i just don't know how to change the labe-font. tried #edit-name in style.css but doesnt work.
Comment #9
Barry Madore commentedchanging component
Comment #10
davideads commentedI updated this to reflect Drupal 6 theming techniques and tested them with my custom theme.
However, I think that the structure and form could use work, so I'd love some review here.
There are also seem to be several variations on this theme in the handbook, and probably they should be combined and cleaned up to form a canonical version of this snippet.
Comment #11
davideads commentedI talked with Addy who said just to mark this fixed and move on :)
Comment #12
Eli. commentedThe file should be "user-login.tpl.php" and not "user_login.tpl.php" (underscore - no no...).
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
lacitpo commentedsubscribing
Comment #15
holeepassion commentedHI there
Where do I find this file ? is it in the user module ?
I want to adjust the length to match the theme, http://www.malebodydecor.com
How do I do this please ?
Thanks
Comment #16
Mick Cagney commentedLooking to get rid of the following error:
_____________________________________________________
Access denied
You are not authorized to access this page.
_____________________________________________________
on the landing page. Where could I do this?
Comment #17
jhodgdonMick -- This issue is closed. If you are having trouble with documentation, please open a new issue. If you are having trouble with your own web site, please scroll up to the top of Drupal.org and click on "Community and support" to learn about viable support options: Forums and IRC.