0

We want to display a 3 tab "Create new account(Lawyer Registration)" , "Log In" , "Forgot Password" link on 3 different pages. when we click on log in then they display all 3 tabs.

Actually we have 2 different type of registration process one for lawyer and another one is for normal user. when we click to login then they display above 3 tabs and this is confusing for user. so i want to hide this lawyer registration process form user page and call them to from different page.

So please help me how i can remove them from above tabs and call user/register page from different ways.

1

One quick solution to hide the tabs is to change the menu type form tabs to callback:

/**
 * Implements hook_menu_alter().
 */
function yourmodule_menu_alter(&$items) {
  $items['user/login']['type']    = MENU_CALLBACK;
  $items['user/register']['type'] = MENU_CALLBACK;
  $items['user/password']['type'] = MENU_CALLBACK;
}

You could render the user register form whatever you want with this:

$elements = drupal_get_form("user_register_form"); 
$form = drupal_render($elements);
echo $form;
  • I put that code in user.module but nothing happens. – Swapnil0226 Dec 24 '14 at 11:42
  • You need to put the hook function in a new custom module and clear the caché, also rename "yourmodule" with your module name. – jorgetutor Dec 24 '14 at 11:45
  • actually i am new to drupal. i dont know how to create a hook menu.please guide me – Swapnil0226 Dec 24 '14 at 12:05
  • Second code is working fine.Now i just need to remove them form user page. – Swapnil0226 Dec 24 '14 at 12:20
  • You can follow this tutorial to create your first module: drupal.org/node/1074362 :) – jorgetutor Dec 24 '14 at 12:28
0

This is perfectly possible with the use of Profile2 module (https://www.drupal.org/project/profile2) in combination with Profile2 regpath module (https://www.drupal.org/project/profile2_regpath)

This way you can setup a specific registration path per profile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.