solved Advanced Login Redirect Options

Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
5 years ago
823 posts
Please can you guys create an option for login redirection, so that a user can be directed back to the original source page they came in on. I had this option on my Social Engine site and it was very useful for gathering comments on blogs and other items when shared on Facebook, Twitter etc. For example, if i share a blog about whatever from my site onto Facebook or anywhere else. I get people clicking the link that are not logged in to my site or not even members which is great but, the first thing they wanna do is comment on it. The problem with Jamroom is that when they log in they are redirected to a landing page and are not redirected back to the blog or whatever item they clicked in the first place that they wanted to comment on. I know and i am sure you know that you can just click the back button a few times after logging in to get to that original page but no one is gonna do that. I feel like an option like this would drastically increase user engagement.
updated by @zachary-moonshine: 01/31/20 05:13:02AM
paul
@paul
5 years ago
4,325 posts
Hi Zach - This is a good suggestion but at the moment not sure how easy it would be to do.
I'll bring it up at the JR team meeting this week and let you know.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
5 years ago
10,136 posts
This is actually already supported and should be working. Any "view" that includes the jrUser_session_require_login() function already does this - and that is like 90% of views.

Where do you see this not working?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
paul
@paul
5 years ago
4,325 posts
I think what Zach is saying is that if you go to the login page from a skin page (which isn't a 'view' as such) you are not returned to that skin page after login.
Ie. Look at a blog detail page and see the 'You must be logged in to comment' message. Click on it, log in, then you end up on your profile page instead of back on the blog detail so that you can then comment immediately.
Is that correct Zach?


--
Paul Asher - JR Developer and System Import Specialist
Zachary Moonshine
Zachary Moonshine
@zachary-moonshine
5 years ago
823 posts
Yes paul that is correct
brian
@brian
5 years ago
10,136 posts
paul:
I think what Zach is saying is that if you go to the login page from a skin page (which isn't a 'view' as such) you are not returned to that skin page after login.
Ie. Look at a blog detail page and see the 'You must be logged in to comment' message. Click on it, log in, then you end up on your profile page instead of back on the blog detail so that you can then comment immediately.
Is that correct Zach?

As long as the URL as an "r=1" on it, it should redirect. So the comment_form.tpl just needs updating from this:

<a href="{$jamroom_url}/{$url}/login">

To this:

<a href="{$jamroom_url}/{$url}/login?r=1">



--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net