2

I am creating a multi step form and in a one step i want to add user registration and login forms in as tabs and i have custom module which is uses to load multi step form,my problem is how i add registration and login forms in my page i try with things but didi't work out

  function garland_user_bar() {
  global $user;                                                                
  $output = '';

  if (!$user->uid) {                                                           
    $output .= drupal_get_form('user_login_block');                            
  }                                                                            
  else {                                                                       
    $output .= t('<p class="user-info">Hi !user, welcome back.</p>', array('!user' => theme('username', $user))); 

    $output .= theme('item_list', array(
      l(t('Your account'), 'user/'.$user->uid, array('title' => t('Edit your account'))),
      l(t('Sign out'), 'logout')));
  }

  $output = '<div id="user-bar">'.$output.'</div>';
  return $output;
}
  • 1
    $login_form = drupal_get_form('user_login')` you need to render the form in output $output .= drupal_render($login_form) – Petro Popelyshko Mar 15 '13 at 8:01
1

You to need render the form element.

Use the following to print the forms:

print(drupal_render(drupal_get_form('user_register_form')));
print(drupal_render(drupal_get_form('user_login_block')));
| improve this answer | |

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.