Registration and Login form customization

Hi EveryOne,

I want o customize the registration form and login form and combine these two form on same page ,i tried to get solution on drupal

0 3 428
3 REPLIES 3

Not applicable

@AbdulRehman: this is pretty easy to do in a custom module. Here's a barebones sample:

<?php
/**
 * Implements hook_menu().
 */
function mymodule_menu() {
  $items = array();
  $items['user/login-register'] = array(
    'title' => 'Log in or register',
    'page callback' => 'mymodule_login_register',
    'access callback' => TRUE,
  );
  return $items;
}
/**
 * Menu callback to show login and register forms on same page.
 */
function mymodule_login_register() {
  return drupal_render(drupal_get_form('user_login')) . drupal_render(drupal_get_form('user_register_form'));
}

This puts the two forms on the same page, accessible at the URL /user/login-register. If you want to put both forms on an already-in-use URL such as /user/login, you'll need to implement hook_menu_alter() instead of hook_menu(). See the official Drupal API documentation for more info.

Hi @AbdulRehman, did you resolve to combine the two forms on the same page? I was looking how to do it but i can't get information

<p>For Drupal 7, you can use LoginToboggan. It has a feature "Present unified login/registration page", see: https://www.ostraining.com/blog/drupal/logintoboggan</p>;