Join us on the demo, while our product experts provide a detailed walkthrough of our enterprise platform.

logoAsync

The latest news in the world of engineering.

Identity and Access Management (IAM), including security and customer experience.

Visit Blog
Fuel

Grow your business to millions.Engage and retain your customers.

Visit Blog

Customize User Login, Register and Forgot Password Page in Drupal 7

Did you ever want to customize your registration or login page on Drupal 7, but did not know how? Customizing these pages by adding new text or changing theme…

Versha Gupta
Versha Gupta
August 11, 2015
1 min read

Free, Secure and Trusted Way to Authenticate Your Visitors

Add login to your website in 5 minutes completely for free!

Free Sign UpNo hidden costs. No credit card needed.

Did you ever want to customize your registration or login page on Drupal 7, but did not know how? Customizing these pages by adding new text or changing theme is not a difficult task.

To help you out with that, I have compiled some simple steps to customize your registration or login page. All that you need to do is to add the following code :

Steps:

  1. In the first step of customization, you need to implement hook_theme in your module file.
 array(
      'template' => 'user_login',
      'render element' => 'form',
      'path' => drupal_get_path('module', 'yourmodule') . '/templates'
    ),
    'user_pass' => array(
      'template' => 'user_pass',
      'render element' => 'form',
      'path' => drupal_get_path('theme', 'yourmodule') . '/templates'
    ),
    'user_register' => array(
      'template' => 'user_register',
      'render element' => 'form',
      'path' => drupal_get_path('theme', 'yourmodule') . '/templates'
     ),
  );
  return $theme;
}-->

Now that you have implemented hook theme in module file, the next step is to implement three pre-process functions. These functions are used if module needs to override or you want to add something in theme pre-processing.

In the third step, you need to create following template files for login/register/forgot password.

  1. user_login.tpl.php
  2. user_register.tpl.php
  3. user_pass.tpl.php

Now paste the following code into user_login.tpl.php. Also, don’t forget to modify user_register.tpl.php and user_pass.tpl.php template files accordingly.

<!--

  
-->

Now your login page will contain new intro text This is my awesome login form. Customization of registration page in Drupal 7 is not difficult and if you follow above mentioned tips, you can design an amazing registration / login / forgot password page according to your audience.



LoginRadius Docs

Implement Authentication in Minutes

click here

Most Popular Tags

EngineeringJavaScriptReactNodeJsAuthenticationCSSSecurityOAuthC#Go

Are your customers safe on your application?

According to Forbes, data breaches exposed 4.1 billion records in the first six months of 2019. If this gets you worried, we’ve got your back!

LoginRadius protects your customers’ identities. We provide world-class security for your customers during login, registration, password setup, and any other data touchpoints, and make sure that their data is safe. We do so through by offering open source SDKs, integrations with over 150 third party applications, pre-designed and customizable login interfaces, and best-in-class data security products such as MFA, RBA, and Advanced Password Policies. The platform is already loved by over 3,000 businesses with a monthly reach of 1.17 billion users worldwide.Secure Your Application Now

Versha Gupta

Versha Gupta

I am a software enthusiast and contributor interested in React JS, UI/UX, Tech Blog, Javascript, Node JS, DevOps.

View Profile

Try a Modern Authentication Solution

$0/ month

Free Sign Up
  • 7,000 Monthly Active Users
  • 1 Web or Mobile App
  • Email/Password Login
  • 3 Social Login Providers
  • User Data Storage
  • Transactional Email Template
  • Customizable Login Interfaces