Hw can i get just the latest child to display?
->Parent
----->C3
----->C2
----->C1
So just C3 would be displayed in the Parent?
Thanks
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hw can i get just the latest child to display?
->Parent
----->C3
----->C2
----->C1
So just C3 would be displayed in the Parent?
Thanks
<% if First %>
<ul>
<% control Children %>
<li><a href="$Link" title="Go to the $Title.XML page" id="$LinkingMode">$MenuTitle</a></li>
<% end_control %>
</ul>
<% end_if %>
Thanks had to change it to make it work by moving the if First:
<ul>
<% control Children %>
<% if First %>
<li><a href="$Link" title="Go to the $Title.XML page" id="$LinkingMode">$MenuTitle</a></li>
<% end_if %>
<% end_control %>
</ul>
I was close =p
I wonder if you could make that even shorter by using <% control Children.First %> ?