Mura Iterators

In short, an "iterator" is an array of objects. Mura iterators make managing content and users simpler by providing direct access to objects and their properties as well as offering a number of "helper" methods.

A Mura Iterator wraps a traditional CFML query object. It is most often used in conditional loop statements:

And the first line inside of the condition loop is obtaining a reference to the actual next value object:

And you then can use it for whatever the purpose of the iteration is for:

It is very important to note that the the iterator.hasNext() is page aware. The Mura Iterator was built with pagination in mind. This means that iterator.hasNext() with only return true if it was iterated through less than the value of its iterator.getNextN() value.

For example, if an iterator has 20 items inside of it, the following code would output the first 10:

If you set the value of the Iterator's nextN to 0 it will set next to the recordcount of the current query:

You can change the page that is iterated through by settings the iterator's current page:

You can also iterate backwards as well: