I made a template for the login block on the main page. It works.
Here is user-login.tpl.php code:
<?php
$elements = drupal_get_form('user_login_block');
?>
<div class="login">
<div class="login_header">Login</div>
<?php
print drupal_render($elements["form_id"]);
print drupal_render($elements['name']);
print drupal_render($elements['pass']);
?>
<div class="forgot_password">
<a href="/" class="forgot_password">Forgot password</a>
</div>
<input type="submit" name="" value="Log in" />
<a href="/" id="sign_up">Sign up</a>
</div>
<form>
and <div>
tags were added around my template code, breaking the layout. Now the block doesn't float: left.
Here is the rendedered HTML:
<form action="/node?destination=node" method="post" id="user-login-form" accept-charset="UTF-8"><div><div class="login">
<div class="login_header">Login</div>
<input type="hidden" name="form_id" value="user_login_block" />
<div class="form-item form-type-textfield form-item-name">
<label for="edit-name--2">Login <span class="form-required" title="This field is required.">*</span></label>
<input type="text" id="edit-name--2" name="name" value="" size="15" maxlength="60" class="form-text required" />
</div>
<div class="form-item form-type-password form-item-pass">
<label for="edit-pass--2">Password <span class="form-required" title="This field is required.">*</span></label>
<input type="password" id="edit-pass--2" name="pass" size="15" maxlength="60" class="form-text required" />
</div>
<div class="forgot_password">
<a href="/" class="forgot_password">Forgot password</a>
</div>
<input type="submit" name="" value="Log in" />
<a href="/" id="sign_up">Sign up</a>
</div>
</div></form>
How to remove extra <div>
and put the form inside <div class="login">
? I tried that manually, but then I get 2 forms.