Skip to content

Instantly share code, notes, and snippets.

@danreb
Created November 20, 2013 10:15
Show Gist options
  • Save danreb/7560816 to your computer and use it in GitHub Desktop.
Save danreb/7560816 to your computer and use it in GitHub Desktop.
Customizing Drupal 7 Login
<?php
function THEMENAME_theme() {
$items = array();
// create custom user-login.tpl.php
$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'THEMENAME') . '/template',
'template' => 'user-login',
'preprocess functions' => array(
'THEMENAME_preprocess_user_login'
),
);
return $items;
}
<?php
print drupal_render($form['name']);
print drupal_render($form['pass']);
print drupal_render($form['form_build_id']);
print drupal_render($form['form_id']);
?>
<!-- Print create account and password reset links -->
<div class="custom-login-links">
<a href="/user/register" title="Create an account">Sign up</a> |
<a href="/user/password" title="Reset your password">Forgot your password?</a>
</div>
<?php print drupal_render($form['actions']); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment