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

Getting just 1 child to Display


Reply

5 Posts   1654 Views

Avatar
corkg

28 August 2008 at 9:22pm Community Member, 30 Posts

Hw can i get just the latest child to display?

->Parent
----->C3
----->C2
----->C1

So just C3 would be displayed in the Parent?

Thanks

Avatar
grilldan

28 August 2008 at 9:50pm Community Member, 135 Posts

<% 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 %>

Avatar
corkg

28 August 2008 at 9:54pm Community Member, 30 Posts

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>

Avatar
grilldan

28 August 2008 at 9:56pm Community Member, 135 Posts

I was close =p

Avatar
Sean

28 August 2008 at 10:07pm Forum Moderator, 921 Posts

I wonder if you could make that even shorter by using <% control Children.First %> ?