3

I have a lightbox pop up when a link is clicked to sign up for the site but, after signing up i don't want them to redirect to their user profile page, I need them to stay on the same exact page. Is this possible?

I tried login destination but that feature only works for the login not registration.

2
  • What module shows the Lightbox pop-up with the login link?
    – apaderno
    Commented Jul 12, 2011 at 17:26
  • im using hardcoded modal plugin called leanModal. its just a lightweight modal that will show the register form in it
    – delboud
    Commented Jul 13, 2011 at 0:49

4 Answers 4

2

You could also use the Rules module.

1
  • I have that installed and couldn't seem to get it to make the user stay on the same page after actually making a new account, you have an idea how I can achieve this?
    – delboud
    Commented Jul 13, 2011 at 0:52
1

Try the LoginToboggan module. It has alot more features and community support than login destination module

3
  • I have it installed but doesn't do what I need it to do.
    – delboud
    Commented Jul 12, 2011 at 15:05
  • Thanks for the update, this Drdupal 6 or 7?
    – iStryker
    Commented Jul 12, 2011 at 15:10
  • This is drupal 6
    – delboud
    Commented Jul 13, 2011 at 0:47
1

Cleanest way is probably to just write a little module. In it, use hook_user() to change the destination URL after login:

/**
 * Implements hook_user().
 */
function mymodule_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'register':
      // set the redirect url to <front>
      $_REQUEST['destination'] = '<front>';
      // OR, uncomment the following to disable redirecting completely:
      // unset($_REQUEST['destination']);
      break;
}
0
0

If you're trying to do this in your own custom module in Drupal 7:

function mymodulename_form_user_register_form_alter(){
    $_REQUEST['destination'] = 'anywhere_you_want_to_go_to';
}

hook_form_user_register_form_alter() always runs on the registration form. Change mymodulename to your module and make sure it's on.

The second line is the line that redirects on submit (if it validates). I don't know of any way to not redirect, but you can redirect to the page you're redirecting away from for the same result. Change the "anywhere_you_want_to_go_to" string to the page you want to go to. eg. "user/register" or "<front>".

1
  • The OP is asking for a way to avoid the users are redirected to another page once they submitted the registration form.
    – apaderno
    Commented Jan 29, 2013 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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