Created
October 8, 2013 09:51
-
-
Save driesd/6882333 to your computer and use it in GitHub Desktop.
Customize the Drupal user forms (login & register)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_user_login | |
*/ | |
function MODULE_form_user_login_alter(&$form, &$form_state) { | |
$form['already_customer'] = array( | |
'#type' => 'markup', | |
'#markup' => '<h3>' . t('I am already a customer') . '</h3>', | |
'#weight' => -10, | |
); | |
$form['forgot_password'] = array( | |
'#type' => 'markup', | |
'#markup' => '<div class="forgot-password"><p>' . l(t('Forgot password?'), 'user/password', array('attributes' => array('title' => t('Forgot password?')))) . '</p></div>', | |
'#weight' => 20, | |
); | |
} | |
/** | |
* Implements hook_user_register_form | |
*/ | |
function MODULE_form_user_register_form_alter(&$form, &$form_state) { | |
$form['new_customer'] = array( | |
'#type' => 'markup', | |
'#markup' => '<h3>' . t('New here?') . '</h3>', | |
'#weight' => 0, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks <3
it also worked on THEME FILE your_theme_name.theme