Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » creating a login/out link

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 398 Views
  • wake2010
    Community Member
    9 Posts

    creating a login/out link Link to this post

    how do i add a login/out link on the front end of the site?

    i would like it so that when a user is not logged in it shows log in and when they are dynamicly says log out

    any ideas?


  • Sticks
    Community Member
    29 Posts

    Re: creating a login/out link Link to this post

    In your Page.ss (or other .ss template file) you can use something like this:

    <% if CurrentMember %>
    <a href="/Security/logout">Log out</a>
    <% else %>
    <a href="/Security/login">Log in</a>
    <% end_if %>

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.