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.

closed as too broad by kiamlaluno Apr 22 '16 at 6:54

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


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


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.


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.


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)) {
    $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

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