Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

looping thru non-articles

I'm sure this has been addressed before, but I can't find it.

Can you use CityScript to loop thru a folder of images?  I have a folder with about 20 images - rather than linking each one manually, I'd like to create an article than just loops and inserts an <img> tag for each jpg.  Seems like it should work, but CD says it couldn't find the images folder.


Saturday, October 19, 2002

I think the short answer is that looping only works with articles. If each image is in it's own article, you can loop all you want, and pull the image from the body or extra fields.  That's not what you are asking for but it's a way to get it done.

Saturday, October 19, 2002

Using Terry's method, you can burn through CD pages quickly.  I need to do something similar in a site I am building that contains (lots of!) pictures of golf clubs. 

I am putting my images on the server without using citydesk.  I have an Access database that contains (among other things) links to the images.  Then, using server side scripting (in my case its VBScript -- ASP coding) I control the fetching of the images.

With this approach, I can occaisionally change the database and image directory, but the CD built code doesn't need to change at all.

Upkeep of the pictures and their database will probably be done by hand, by me.  If I get adventurous, I might build a front end that can be accessed via web pages to edit the database.

In any case, part of the goal of CD is to be able to give the content people the capability to edit their pages without the need of the technical developer.  If the content is mostly straight text, I think it is easy enough to show someone how to use CD.  But if you need to be doing more complicated stuff (especially involving html tags), then making it easy for the user is pretty hard to do.

Since the tech person is probably going to update the images anyway, why not do it in a way that is easier for the tech person?

Joel C. Goldstick
Sunday, October 20, 2002

*  Recent Topics

*  Fog Creek Home