There was a post Stepping through Child Table Rows on the old forum that I would really like to read. Anyone know how to retrieve this post? Or can someone explain the syntax of how to step through child data like you would an autoslot.
Hi Mark,
That post should still be live: Stepping through Child Table Rows
Pasting Sam’s snippet here:
#foreach( $row in $sys.item.getNodes( '_child\_table\_name_' ) ) $row.getProperty( 'rx:_field\_name_' ).String #end
When I hit the link I get:
mcolebank , you do not have permission to access this page. This could be due to one of several reasons:
- Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else’s post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation
Thanks for letting us know!
It sounds like when we locked the forum down to be read-only - we locked it down a little too much.
I think we cleared the permissions issue - if you could try again / refresh the url. If the problem is still occurring let us know and we will create a Support ticket to track the problem.
-n
I need to be able to order the results from the node by one of the field names. Is that possible with getNode (or $rx.asmhelper.childValues) or do you have to use a slot with a query to do this?
I have two children to the Project content types: Projects and Areas (of Research). I have two lists that I need to generate. One list for projects and one list for areas of research. Can I use a sort function on the array or node? If yes, how do I call the function?
1st method of iterating through child data (This is working)
#foreach( $row in $sys.item.getNodes( ‘Projects’ ) )
$row.getProperty( ‘rx:ProjectTitle’ ).String
$row.getProperty( ‘rx:Scientist’ ).String
$row.getProperty( ‘rx:Summary’ ).String
#end
2nd method of iterating through a child table (this is also working)
#set($myChild_area_array = $rx.asmhelper.childValues($sys.item,“Areas”,“AreaofResearch”))
#foreach ($i in [1…$myChild_area_array.size()])
#set($index = $i - 1)
#set ($myString = $myChild_area_array.get($index).string)
- $myString
#end
Mark,
You could use $tools.sorter.sort for this:
#set($myChild_area_array = $rx.asmhelper.childValues($sys.item,“mychildtable”,“field3”))
#foreach ($i in $tools.sorter.sort($myChild_area_array,“string”))
- $i.String
#end
Please let us know if this helps or if you have more questions.
Regards,
CW