Jump to:

23477 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Different Menus

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: 749 Views
  • Qiming
    Avatar
    Community Member
    5 Posts

    Different Menus Link to this post

    My site has horizontal menus. Before the users log in, I want the menus to point to pages like "Home," "About" and "Contact" ; however, after they log in using my custom made login system (which directs users to a different page), I want the menus to point to other pages like "Add a post" "Edit Posts" and "Delete Posts." Is that possible?

  • 3dgoo
    Avatar
    Community Member
    133 Posts

    Re: Different Menus Link to this post

    Yes this is possible.

    In the CMS you can control who can access each page in the access tab of that page.

    Set Who can view this page to either Logged-in users or a choose a group with Only these people (choose from list).
    These pages won't be viewable and shouldn't appear in the menu for people who aren't logged in.

  • Qiming
    Avatar
    Community Member
    5 Posts

    Re: Different Menus Link to this post

    Hi ampedup, thanks for your response. Is there any way to make a menu visible to only those who are not logged in? I don't think an "about us" or "FAQ" section is necessary for those logged in already, but will be very helpful for those who are deciding whether or not to register for an account. Therefore, I want to get rid of those menus for logged in users. Thanks again!

  • 3dgoo
    Avatar
    Community Member
    133 Posts

    Re: Different Menus Link to this post

    Damn, that complicates things.

    Here is another post about your problem:
    http://www.silverstripe.org/data-model-questions/show/266450

    If that doesn't help we can try something else.

  • Qiming
    Avatar
    Community Member
    5 Posts

    Re: Different Menus Link to this post

    I read over the post, but didn't really quite understand what banal was talking about. It seems like his code checks whether a user is logged in, admin or not logged in. Based on the status, it will return a Boolean value. How would that be different than, say:

    function canView(){
       return (Member::currentUserID()?false:true);
    }

    Wouldn't this check for whether the user is logged in also?

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