Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

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

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

Limiting Menu Controller returns


Reply

3 Posts   1474 Views

Avatar
camspiers

1 July 2008 at 4:57pm (Last edited: 1 July 2008 4:59pm), Community Member, 5 Posts

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.

Avatar
Willr

1 July 2008 at 5:18pm Forum Moderator, 5511 Posts

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.

Avatar
camspiers

1 July 2008 at 10:30pm (Last edited: 1 July 2008 10:31pm), Community Member, 5 Posts

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.