Hi there,

i have an issue keeping a custom login password and register page running. I'm also a total newbie to this topic, but have read a lot around, and it seems that it just happens to the Omega theme, since Bartik prints out the custom page.

Basically i have tried several ways.

1st that is the forum i have read https://drupal.org/node/1949472

Right now, i have

  • page--user--login.tpl.php
  • page--user--password.tpl.php

page--user--login.tpl.php has

/*
 *    Custom Login form
 */
function wellsters_1_0_form_alter(&$form, &$form_state, $form_id) {
    if ( TRUE === in_array( $form_id, array( 'user_login', 'user_login_block') ) ) {
        // Javascript placeholders for Username and Password (old browsers)
        // Almost all browsers support HTML5 nowadays
        // If you don't want it remove it : )
        $form['name']['#title_display']['onblur'] = "if (this.value == '') {this.value = 'Username';}";
        $form['name']['#title_display']['onfocus'] = "if (this.value == 'Search') {this.value = '';}";
        $form['pass']['#title_display']['onblur'] = "if (this.value == '') {this.value = 'Password';}";
        $form['pass']['#title_display']['onfocus'] = "if (this.value == 'Search') {this.value = '';}";
        // "Login" form (no label, no description and with HTML5 placeholder)
        $form['name']['#title_display'] = "invisible";
        $form['pass']['#title_display'] = "invisible";
        $form['name']['#attributes']['placeholder'] = t( 'Username' );
        $form['pass']['#attributes']['placeholder'] = t( 'Password' );
        $form['name']['#description'] = t('');
        $form['pass']['#description'] = t('');
    }
    if ($form_id == 'user_pass') {
        // Javascript placeholders for Request Password page (old browsers)
        // Almost all browsers support HTML5 nowadays
        // If you don't want it remove it : )
        $form['name']['#title_display']['onblur'] = "if (this.value == '') {this.value = 'Type your username or e-mail address';}";
        $form['name']['#title_display']['onfocus'] = "if (this.value == 'Search') {this.value = '';}";
        // "Request new password" form (no label and with HTML5 placeholder)
        $form['name']['#title_display'] = "invisible";
        $form['name']['#attributes']['placeholder'] = t( 'Type your username or e-mail address' );
    }
}

page--user--password.tpl.php has

<?php print $messages; ?>
<?php print drupal_render(drupal_get_form('user_pass')); ?>
<a href="user/login">Go back</a>

Right now, i have put them in the templates folder of my subtheme, in the original omega/omega but the code didn't get called, i have tried with Panels to output Page Elements --> Page Content, but with this way, the normal login form get called.

Note that the above code, i have just put into to get the page at first, customization will follow later.

Would be glad if somebody could help me somehow out with this.

Cheers

Stefan

Comments

msmithcti’s picture

Status: Active » Closed (cannot reproduce)

page--user--login.tpl.php works faultlessly for me when used in an Omega sutheme. Not to point out the obvious, but did you remember to flush the caches? Please feel free to reopen this if can provide some additional instructions to reproduce this.