Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

How to Loop from 3rd Article so on

Would you like to help me, how to loop (listing) articles from 3rd article to ten articles after that? All articles in one directory, Article

Ahmadie Thaha
Thursday, October 30, 2003

I think this has been asked before.  CityScript can't do this automatically.  You could use the keywords feature to test for some value that would discard the first three articles, but each time you add a new article you would have to edit out the keyword in the 4th article.

Joel Goldstick
Thursday, October 30, 2003

You could create a separate folder with all of the articles you want "returned", and limit the number of articles in your foreach statement.  For example let's say you have a folder "archives" that contains all of your articles, but you want only the latest 4 returned. 

This loop sorts the articles descending on "filed date", returns the most recent 4 articles, and displays the contents of the "author" box from the Properties tab associated with each article:

{$foreach 4 x in (folder "archives") sortDescendBy .filedDate$}<p><a href="{$$}">{$$}</a></p>{$next#}

Tuesday, November 4, 2003

*  Recent Topics

*  Fog Creek Home