Jump to:

23457 Posts in 18905 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Registration Form

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: 2001 Views
  • Terminator4
    Avatar
    Community Member
    81 Posts

    Registration Form Link to this post

    Hey Guys,
    Just want to find out how I can remove the Registration Form from the menu once a user is logged in and show the Log Out button instead?

    Thanks

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Registration Form Link to this post

    Hi Terminator

    You could use something like this:

    <% if CurrentMember %>

    $LogoutButton

    <% else %>

    $LoginForm

    <% end_if %>

    Take a look at the forum module as it has something like this implented

  • Terminator4
    Avatar
    Community Member
    81 Posts

    Re: Registration Form Link to this post

    Thanks man... unfortunately this is not really what I am looking for. I am looking for a scenario where I could choose what menu items are only for users logged in and others for the general public. But taking into consideration that the main menu is generated my SS so I cannot really use the option you suggested... can I?

    Unfortunately there is no more extensive documentation. If I could just get hold of the SS guys or get them to respond to my mails with my few questions then I would be able to contribute, further, to the current documentation.

    Thanks anyways

    PS: Any future assistance would be greatly appreciated by me and the rest of the community

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Registration Form Link to this post

    Well, Aram answered your 1st question perfectly.

    To answer your new, completely difference question - page level access is set in the CMS. Find the page, click on the "Access" tab. From here you can set who can and can't view the page. The pages you want hidden to the public, set as 'Logged-in users only'. It will disappear from the menu for logged out users.

  • Terminator4
    Avatar
    Community Member
    81 Posts

    Re: Registration Form Link to this post

    Okay.... I am still unsure of how to add a logout button to the menu. I guess I would need to create a function and use that as the hack. Yes?

  • chrisdarl
    Avatar
    Community Member
    33 Posts

    Re: Registration Form Link to this post

    Open your menu .ss file

    add the following code whereever you want the button to be

    <% if CurrentMember %>

    $LogoutButton // or code for your logout button

    <% end_if %>

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