You are here

Creating custom user login page in Drupal 7

Last post
5 posts / 0 new
Dan
Dan's picture
Offline
Last seen: 3 hours 19 min ago
Joined: Jun 2012
Points: 377

Creating custom user login page in Drupal 7

danpros wrote:

Maybe sometimes we want a custom style for our Drupal login page, different with the existing default login page in Drupal 7, whether it's for a personal project or client requests.

Read more http://www.danpros.com/2013/01/creating-custom-user-login-page-in.html

Below are the complete code.

Paste in your template.php:

function yourthemename_theme() {
  $items = array();
  // create custom user-login.tpl.php
  $items['user_login'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'yourthemename') . '/templates',
  'template' => 'user-login',
  'preprocess functions' => array(
  'yourthemename_preprocess_user_login'
  ),
);
return $items;
}

Paste in your user-login.tpl.php:

<?php ?>

<?php print drupal_render($form['name']);?>
<?php print drupal_render($form['pass']);?>
<?php print drupal_render($form['form_build_id']); ?>
<?php print drupal_render($form['form_id']); ?>
<?php print drupal_render($form['actions']);?>

Dan,
Follow me danpros and danbz.

luxiezas's picture
Offline
Last seen: 41 min 16 sec ago
Joined: Feb 2013
Points: 76

thanks

Thank you for this information Dan Good

Septictankbiorich.comBiotech System
SeptictankbiorichBioRich, Biotech, Biofil
Surya Utama FibertechFibreglass

Offline
Last seen: 2 months 3 weeks ago
Joined: Feb 2013
Points: 1

wow great, this i come from .

wow great, this i come from ...

wayankatel's picture
Offline
Last seen: 4 days 6 hours ago
Joined: Mar 2013
Points: 16

Simple step but not so easy

Simple step but not so easy

Offline
Last seen: 4 weeks 1 day ago
Joined: Apr 2013
Points: 4

I saw someone recommended the

I saw someone recommended the new plugin for this login page. Does anyone know this?