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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

[SOLVED] limit menu in subpages


Go to End


3 Posts   1739 Views

Avatar
alienn

Community Member, 15 Posts

14 July 2010 at 11:09am

Edited: 20/07/2010 5:02am

hey

i'll have page structure sth like that :

TOP
A | B
A1 | A2 | B1 | B2
A11 | A12 | A21 | A22 | B11 | B12 | B21 | B22

how do i limit menu links to A and B on TOP
A1 A2 on A
B1 B2 on B
A11 A12 on A1
etc..

all of this withoutall other links (including higher level)

is there a simple way to do this ?
Thanks in advance

Avatar
3dgoo

Community Member, 135 Posts

16 July 2010 at 12:27pm

So on any given page, you don't want any links to come up except the direct children?

If thats right then:

<% if Children %>
	<ul>
	<% control Children %>
		<li><a href="$Link" title="Go to the &quot;{$Title}&quot; page">$MenuTitle</a></li>
	<% end_control>
	</ul>
<% end_if>

Avatar
alienn

Community Member, 15 Posts

20 July 2010 at 5:03am

that's exactly what i wanted, thanks for help