Display original article page after login

More
3 years 7 months ago #138054 by jr
Our site currently works as follows.

1. A subscriber (who is not logged in) accesses an article page that has restricted content. We've coded the restricted content (via Membership Pro > Emails & Messages > Content Restricted Message) to say:
*Subscribe here* for unlimited access. Subscribers: *log in*.

2. If the user clicks on *Subscribe here*, we send them to the Subscription Plans page so they can subscribe. If the user clicks on *log in*, we send them to the login page.

3. If the user is a current subscriber and clicks *log in* and then successfully logs in, the site displays the user's profile.

In step 3 above, we instead want the site to display the article from which the subscriber accessed the login page--which then will display the restricted content.

Can we do this via Membership Pro?
The following user(s) said Thank You: CJ Gilbert

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138317 by CJ Gilbert
Replied by CJ Gilbert on topic Display original article page after login
ME TOO! I created one plan that redirected to the member page after login.

Now that I have a few plans, that doesn't work anymore.

How can we make sure they go to the right page after they log in, based on the plan they have?
(This seems very different than the success page.)

We DON'T want to take them to their profile... what do you advise?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138319 by jr
Evidently, others have had this challenge for years:

forum.joomla.org/viewtopic.php?t=729718

That thread, tho, hasn't given me a solution yet.
The following user(s) said Thank You: CJ Gilbert

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138320 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display original article page after login
Not sure how you coded the Login Link. However, the link should contains a return variable to tell Joomla the URL you want to redirect users to after they login

Something like this:
Code:
$loginLink = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode(JUri::getInstance()->toString()), false);

That should the login link. If users click on that link and login, they will be redirected back to previous page

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138337 by jr
Thanks, Ngoc.

I have the user login link on each article page linked to Menu > Main Menu > Log in/out

In the Menu Manager, I have the parameters for the "Log in/out" menu item set thus:

Details:
Menu Item Type = Login Form
Link = index.php?option=com_users&view=login
Target Window = Parent

Options:
Choose Login Redirect Type = Menu Item
Menu Item Login Redirect = Default

Where might I enter the "return variable" code that you cited?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138346 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display original article page after login
For this, you cannot enter code for return variable. In your case, maybe you can submit a support ticket sending us:

- Super admin account of the site
- Link to the restricted article which has the login link which you mentioned

We will then check to see what's wrong and get it sorted

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138350 by jr
I'll gladly give you admin access (as I have in the past).

But first I want to tell you that we have the login link in hundreds of articles. Does that matter?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138414 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display original article page after login
The main question is how you add that link to your article? or it's added by our plugin?

Tuan

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138458 by jr
In each article with restricted content, we display the login link using via Membership Pro > Emails & Messages > Content Restricted Message (see the attached images).

Does that answer your question?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #138463 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display original article page after login
Hello

Please submit a support ticket sending us:

- Super admin account of your site
- Link to that article page (which is being restricted)

I will look at it and find a solution

Regards,

Tuan

Please Log in or Create an account to join the conversation.