Forums/How Do I ... ?

Counting iterations

jim merrick
posted this on September 29, 2010, 19:08

I have a number of loops where I am traversing the database, and I would like to know what iteration or pass I am on. There must be a built-in iteration counter somewhere, right? So in the following example, I would like to paginate every 4th item, but I cannot see how to access the counter?

 

    <w:kb:item:each type="Blog" category="Featured" by="rating">

       <!-- insert pagination code here -->


      <h4><href="<w:path url='news-article' />"><w:name /></a></h4>

 
    </w:kb:item:each>

 

Thanks,

 

Jim
 

 

Comments

User photo
Michael Slater
Webvanta

Jim, for this you should use our built-in pagination features:

http://support.webvanta.com/article/77213-displaying-paginated-data...

I'll also check to see if there is a count available in WebvantaScript.

September 29, 2010, 22:52
User photo
Michael Slater
Webvanta

Turns out we don't expose the count consistently in WebvantaScript. We've added it to the to-do list. Let me know if you need it for what you are trying to do, or if the built-in pagination will suffice.

September 30, 2010, 00:17