Hi there!
I´m creating a custom log-in block, and want to put inside there the Remember me checkbox.
Anyone could help me on how to do that? I mean, this is what I´ve got, but ain´t working:
<input type="checkbox" name="remember_me" id="remember" value="1" tabindex="3" />
<label for="remember">Recordarme</label>
Any ideas?
Thanks!!!
Rosamunda
Comments
Comment #1
frankspin commentedSubscribing
Comment #2
Rosamunda commentedanyone?
Comment #3
nickl commentedExactly how is this implemented? The custom form will still need to submit to user login to authenticate the user. Can you authenticate with your supplied username and password fields?
Please provide more information.
Comment #4
nickl commentedNo response for 6 weeks, closing.
Feel free to reopen the issue if more information becomes available.
Comment #5
atin81 commentedOk, I'm going to reopen this. I'm trying to create a custom login block using theme function and this user-login-block.tpl.php file
Now the question is, how do I make "Remember me" checkbox render?
Comment #6
nickl commentedNope that won't work besides, I am sure you are breaking a fare amount of rules here but if it works then I guess go for it.
We are using hook_form_alter to add the checkbox so you will probably need to call drupal_get_form('user_login_block'); somewhere.
Have you tried just including the remember_me checkbox html as you did with name and password?
Please post the result if you got it to work.
Comment #7
atin81 commentedSorry for late respond, just being bussy with other part of the project and until today I don't have look into this.
As you sugested, adding this code make the trick:
Now my question, you have told me that I have break many rules with this custom implementation, but I tried lot of ways to customize the userlogin block and this was the only one to works for me, could you please indicate me what will be the right way to make this?
Thanks in advance.
Comment #8
nickl commentedHey if it works for you I say go for it =)
My theming foo is not all that up to speed but if you call drupal_get_form('user_login_block'); it will return the rendered html after allowing all the other modules to do their hook_form_alter implementations.
If you want to be able to specify a custom theme to be used for a specific form to be used when drupal call drupal_get_form, rather make a hook_form_alter implementation and set the $form['#theme'] to point to your template and the new data will be passed to it when drupal_render_form calls drupal_render to invoke the theme hook you specified.
This way you don't bypass any of the normal drupal functionality and you still allow the contrib modules to do the work they expected to do. This is what I meant by breaking the rules, as modules rely on being called and lots of things can go wrong when they don't. Like the Remember me checkbox vanishing from your login form.
Hey lookie here Login form theming now what have you.
Don't hurt the kittens =) hope this helps.