Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

foreach x in folder where x is an image file

I am learning the new features in 2.0.  I want a foreach loop to loop over images files in the /images directory. Reading the scripting help file I see that foreach only works for articles -- not files.

I rarely play with images, so forgive me if this has been covered.

Is there a way to do this:

{$ foreach x in {folder "images"}
  <IMG src="{$x.fileName$}"
    alt="{$x.headline$}"    >

{$ next $}

Joel Goldstick
Tuesday, May 13, 2003

http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=6850&ixReplies=3

www.marktaw.com
Tuesday, May 13, 2003

Thanks Darren.  So, I now make the reqest that CD be able to loop over files as well as articles. If you could, and by combining the new prev-next features it seems it would be easy to create a nifty slide show application with very little scripting!  And if the refresh meta-tag got involved, the whole thing could run by itself!

Joel Goldstick
Tuesday, May 13, 2003

Oops! So used to thanking Darren.  But this time thanks to Mark!

Joel Goldstick
Tuesday, May 13, 2003

Well, it was just me pointing to a Darren post...

www.marktaw.com
Tuesday, May 13, 2003

*  Recent Topics

*  Fog Creek Home