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
@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
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |