Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Limiting Menu Controller returns

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1465 Views
  • camspiers
    Avatar
    Community Member
    5 Posts

    Limiting Menu Controller returns Link to this post

    Hi,

    I have had a look through the forums and doc and tried to find a solution but haven't.

    I want to limit the number of pages retuned from the Menu controller.

    Is this a desirable thing to do? I have first level pages which I do not want to appear in the Main Navigation, such as News and a Custom holder for some JavaScript Slide Menus that advertise interesting pages on the site.

    At the moment I simply unselect the ShowInMenus option in the CMS, but as people editing the site might make a mistake I would like to safeguard this mistake.

    So I want to do something like <% control Menu($level, $limit) %>

    Thanks for your help in advance.

    Oh and the menu for the site is designed to only have 5 items(by choice).

    Cameron Spiers.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Limiting Menu Controller returns Link to this post

    At the moment I simply unselect the ShowInMenus option in the CMS, but as people editing the site might make a mistake I would like to safeguard this mistake.

    You could make the default setting 'ShowInMenus' false so its turned off by default - in case of people creating a page, then at least they have to go enable it.

  • camspiers
    Avatar
    Community Member
    5 Posts

    Re: Limiting Menu Controller returns Link to this post

    Thanks willr.
    Yes, I can do that and have already done it for top level pages. But I would still like to stop any possibility of a admin user creating a new top level page with the showinmenus option on.
    It seems like a simple thing to do. Well, if someone has done this before it would be appreciated.
    Cheers.

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