4

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.

4 Answers 4

4

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

0
3

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.

2

You can use the following code, which requires the Chaos Tool Suite (ctools) module.

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);
}
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.

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