Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How to sign in and stay on the same discussion page.

ProsperProsper ✭✭
edited October 2015 in Vanilla 2.0 - 2.8

I use the code below on the menu navigation buttons for sign-in/sign-out and register link on both the desktop and mobile theme.
But members get redirected to the homepage (recent discussion page) after signing in instead of staying on the same discussion page after signing in. Forum is built on version 2.1.11
Please what is the right code to use to achieve this?

{signinout_link} {if !$User.SignedIn} <li><a href="{link path="entry/register?Target=discussion"}">Register</a></li> {/if}

Comments

  • Options
    peregrineperegrine MVP
    edited October 2015

    prospers said:How to sign in and stay on the same discussion page (via template).

    for SIGN IN with a specific target link - this worked for me, if it doesn't work for you someone might have a different answer.

    based on your code with a tweak....

       {if $User.SignedIn}
        {signinout_link}
        {/if}
       {if !$User.SignedIn}
       <li><a href="{link path="entry/signin?Target="}{$Path}">Sign In</a></li>
       {/if}
    

    or you could use an else if you want.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    ProsperProsper ✭✭
    edited October 2015

    @peregrine, thank you. It worked.
    Please is it possible to add a code to make the sign-in page to pop-out when sign-in link is clicked on?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You can add the class Popup

    <a class="Popup" href="{link path="entry/register?Target=discussion"}">Register</a>

  • Options

    @vrijvlinder - thank you. It worked.

Sign In or Register to comment.