Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » Login Form changes based on BackURL

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 498 Views
  • woodb2
    Avatar
    Community Member
    48 Posts

    Login Form changes based on BackURL Link to this post

    Up until now I've always been logging in by adding /admin to the url. When I do this I'm greeted with the login form that says " Please choose an authentication method and enter your credentials to access the CMS"

    I'm building a site where users can post a tip. I'm using the blog module and creating a link in the Sidebar that basically adds a condition that if they're logged in already give them a link to the form. If they aren't logged in it gives a link to security login with a backurl to the form.

    Functionally it works great. The only problem is I modified the text I'm usually greeted with in the en_US.php file to say "You must first login in order to post a tip". That text doesn't display with the backURL points to the form. It only displays when you are going to the admin area. How can I easily get the text to display when they are posting a tip?

    <div id="Sidebar" class="typography">
    <% if CurrentMember %>
    <h3><a href="home/post/">Post a new tip</a></h3>
    <% else %>
    <h3><a href="Security/login?BackURL=%2Fsscode%2Fhome%2Fpost%2F">Post a new tip</a></h3>
    <% end_if %>
       $SideBar
    </div>

    Thanks,
    Brian

    498 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.