Jump to:

10928 Posts in 2612 Topics by 1809 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: 389 Views
  • wake2010
    Avatar
    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?

    thanks

  • Sticks
    Avatar
    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 %>

    389 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.