Hello,
In the project I’m working on, I have a comments section on by blog posts. And I want only members to be able to leave comments. So if the visitor is not logged in, I have prompt with a link asking them to login to leave a comment. Which opens up the login page /auth/login.
After the person logs in, I want them to be redirected back to the previous page they were on. The exp:member:login_form return=”” only allows you to send them to a predetermined page.
Is there a way to have the form send them back to the page they navigated to the form page from? Or should I perhaps just put the form in a popup window to avoid the whole links and redirects?
Thanks, Viktor
I’d put a login form on the comments page itself and redirect to return="{current_url}"
If you prefer to avoid handling redirects, you can use a popup window for the login form. This way, the user remains on the same page, and after logging in, the popup can close, and the main page can refresh to reflect the logged-in state.
void(0);”]Login to leave a comment
[removed] function openLoginPopup() { var loginWindow = window.open(‘/auth/login’, ‘Login’, ‘width=600,height=400’); loginWindow.onunload = function() { location.reload(); }; } [removed]
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.