Author Topic

Nathan Kelly

Tuesday 04 July 2006 4:44:13 pm

Comment46304

Ok I've made some progress here but I'm one step off the solution and I can't figure it out.

For my navigation I'm running a request to find my top level nodes, and foreach of these top nodes I'm running a sub request for any children they may contain. Additionaly I'm counting the children with list_count.

My $count returns the number of children (at the moment this is 9).

I'm using:
{foreach $sub_menu as $index => $s_menu}

$index naturally returns 0 - 8.

My problem is that although 8 is the last child, the total number of children is 9 and I can't use offset on list_count, so I can't do something like {if $count|eq($index)}do something{/if}

Which is the sort of thing I need to be able to do, does anyone have any Ideas at all how I might do this? Is there any way to reduce the count by 1, this would work because the total count will always be returned 1 bigger than the index?

Any help really welcome.

Cheers!

Pardon me while I burst into flames...