2

When menu item "Login" is clicked, I want to display the login form as a popup. How can I achieve this?

I have looked into the following but with little luck. (Let me know if the answer is below and I am missing it.)

  • modules: Overlay paths, Popup, Ajax login/register
  • Code: hook_admin_paths_alter()

Any help will be great. I am looking for a clean pop up option that I can theme too.

3

There is a module for that: Modal Forms. Enable and configure it, you're just a checkbox away from modal login :)

| improve this answer | |
2

Are you looking for the Fancy Login module?

Fancy Login adds javascript based, lightbox-style login functionality to your site. When the user clicks on any link that links to /user/login, they screen dims and a login box is created in the center of the screen.

| improve this answer | |
1

Check the TinyBox (Simple Splash) module.

TinyBox module uses TinyBox, a lightweight and standalone modal window script. The main purpose of this module is to provide Splash Screen/Window as simple as possible.

| improve this answer | |
1

You can use ctool modal. Look at the folowing ajax callback of the submit button from the Login form

function mymodule_user_login_block_ajax_callback($form, $form_state) {
  return _mymodule_form_ajax_callback($form, 'mymodule-user-login-block');
}

function _mymodule_form_ajax_callback($form, $wrapper_id) {
  $commands = array();
  $commands[] = ajax_command_replace('#' . $wrapper_id, theme('status_messages') . drupal_render($form));

  $form_errors = form_get_errors();
  if (empty($form_errors)) {
    ctools_include('ajax');
    $commands[] = ctools_ajax_command_redirect('checkout');
  }
  return array('#type' => 'ajax', '#commands' => $commands);
}

For more details take a look at the following article: http://wearepropeople.com/blog/how-to-build-a-popup-in-drupal-for-login-or-register-form

| improve this answer | |

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