Child Table Index

I am working with a children table; from another thread I found out how to find the total count of children in the table. But is there a similar way of finding the index? In a slot $sys.index works fine. In a child table, it does not.

Any suggestions?

Thanks!
Nick D

sorry to bump my thread… but… anybody?

One more time! Is there anyway of finding out the index of a child table’s children?

how are you building the content for your child table entries? I posted some code in the Snippits repository that may help: Stepping through Child Table Rows that shows an example, although to get indices you’ll want to use a slightly different syntax.

something more like:

#set( $rows = $sys.item.getNodes( 'child_table_name' ))
#foreach( $index in [1..$rows.size()] )
#set( $row = $rows.get($tools.math.sub($index,1)))

## your code here... use $row as if it was a $sys.item for the child row.

#end

If you’re intent on using the #children macro, you’ll have to keep digging.

That worked perfect Rushing! Thanks so much!