Jump to:

23581 Posts in 19403 Topics by 2893 members

General Questions

SilverStripe Forums » General Questions » Members Only Page

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 667 Views
  • arferrari
    Avatar
    Community Member
    4 Posts

    Members Only Page Link to this post

    I wanna show the main menu (top menu) with a "Enter" link for not logged users, but if the user is a logged user, I wanna replace the "Enter" link title to My Profile.

    I found the flowing article about Members Only Page but didn't understood very well how to do this.

    http://doc.silverstripe.org/recipes:members-only-page

    Can anyone help me?

  • Mo
    Avatar
    Community Member
    509 Posts

    Re: Members Only Page Link to this post

    Hi arferrari,

    If you only want to check if the user is logged in, and you are adding the link manually, you should be able to use this in your template:

    <% if CurrentMember %><a href="link/to/profile">My Profile</a>
    <% else %><a href="link/to/enter">Enter</a><% end_if %>

    Hope that helps,

    Mo

  • arferrari
    Avatar
    Community Member
    4 Posts

    Re: Members Only Page Link to this post

    Perfect!!!

    Thanks a lot!

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