1

I have a view (d7, views3) that is set up as a table with several fields and the far right column is a global custom text field containing some html like this in the text box:

<a href="/[title]">Enroll</a>

When an anonymous user comes to that page and clicks on that link, it forces them to the login page. But then after they log in, it takes them to their main user page instead of the node that they would have gone to if they had been logged in. Is there a way to send the user to the page they should have gone to after login ??

0

you can set destination after login to which you want the user to redirect to.

So consider this example a login link like www.sitename.com/login?destination=node/1 will take user to node/1 after login.

More detail:

https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get_destination/7

one of you comment says you are using login redirect module, I have not used this module before the module page on drupal.org itself says it covers the functionality you are looking for.

A simple module providing a method to redirect users according to an URL-defined parameter after logging in. Allows redirects toward non-Drupal location.

So the reason the that ?destination is not working, might be because of you a redirect rule triggered by login redirect module.

So solution can be set conditional redirection in login redirect module which can be checked using the parameters in url.

  • So where would I put that login link ?? – ronnienorwood Dec 28 '13 at 17:53
  • how you are taking user to login page? – arpitr Dec 28 '13 at 18:16
  • Not sure. The system is detecting that the user is not logged in when they click on that link to go to the page with that title and brings up a login page. Then they are taken to their main user page. – ronnienorwood Dec 28 '13 at 18:35
  • are you open for custom coding? – arpitr Dec 28 '13 at 18:55
  • I am not sure if the current redirection to login page is handled by system or is there any custom code or any rule making it to behave so.Because if any of the two is the case then your solution might be just adding ?destination parameter to the redirection rule – arpitr Dec 28 '13 at 18:59
0

Go to configuration -> System then clicks on Site information Come to the bottom of the page you will find out "FRONT PAGE"

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.