3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 762 Views |
-
Displaying all children links except current?

24 February 2011 at 11:24am
Hello all!.
I have a multi level navigation site. what I am trying to do is to show a "Also in this section" menu below my current content. So far I have managed to do this by using the following code:<h1>Also in $Level(1).Title</h1>
<ul><% control Menu(2) %>
<li><a class="navigation" href="$Link" title=" Go to $Title.XML">$MenuTitle</a></li>
<% end_control %></ul>
</div>
<% end_if %>However, this code displays a list of all children, but I want my current page to be excluded from this list. Is there a simple code I can use to achieve this? Thanks in advance!
-
Re: Displaying all children links except current?

24 February 2011 at 8:16pm
Wrap your li in a <% if LinkOrCurrent = Link %>...<% end_if %> $LinkOrCurrent will return 'link' or 'current'.
http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls
-
Re: Displaying all children links except current?

25 February 2011 at 5:28am
Ohh, Lovely! Thank you Will! =)
| 762 Views | ||
|
Page:
1
|
Go to Top |


