Using an Iterator Returned From a Method - Mura Docs v6

Using an Iterator Returned From a Method

<cfscript>
//Read out an existing node from the default site.
content = $.getBean('content').loadBy(
filename='blog'
);
// Get an iterator of the node's child content.
iterator = content.getKidsIterator();
// The number of items to be listed is
// determined by the content.getNextN() value.
// Its default is 10.
iterator.setNextN(1);
// You can also set the start row instead of
// setting a page number.
iterator.setStartRow(1);
</cfscript>
<cfoutput>
<cfloop from="1" to="#iterator.pageCount()#" index="p">
<cfset iterator.setPage(p)>
<h2>Page: #p#</h2>
<!---
Iterate through the child content. The iterator.hasNext()
will return true until the page length as determined by the
content.getNextN() has been reached
--->
<ul>
<cfloop condition="iterator.hasNext()">
<!---
The iterator.next() method returns a new contentNavBean.
It acts as a facade to data into the wrapped query
while digging into the full bean when needed.
--->
<cfset item=iterator.next()>
<li>
<a href="#item.getURL()#">
#iterator.currentIndex()#:
#HTMLEditFormat(item.getMenuTitle())#
</a>
</li>
</cfloop>
</ul>
</cfloop>
</cfoutput>