Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Script to generate one item at random?

Sorry if this has been covered, but is there a script that generate one article at random from so-and-so folder? I see the script in the HELP FILE that allows the most recent article to be selected, but is there a way to select on at random?

As long as I'm here, would there also be a script that would generate a list of all articles except the most recent one.

Thanks for any help.

What a great product!

Rick Dooling

Richard Dooling
Saturday, April 12, 2003

Nope, no randomizers in CityDesk.

I can think of ways to get everything except for the past day or week, but not everything except the latest article. We used folders for that... drop it into the archive folder.

The easiest solution is to have the archive include the latest article.

www.marktaw.com
Saturday, April 12, 2003

You might be able to get CityDesk script to generate a JavaScript array of articles then choose and write out a random article using JavaScript.

David Burch
Sunday, April 13, 2003

Well, one could do that with JavaScript if one could write the JavaScript.

www.marktaw.com
Sunday, April 13, 2003

Thanks a lot, you guys. I'm still new to CD and an amateur html person. The archive folder suggestion works fine. Simple is better, and I just needed to plan the site better.

New CD users should definitely read Darren's Tips, especially Managing Content Fragments at  http://www.pool-room.com/CodeCraft/CityDesk/ContentFragments.html 
Ten lightbulbs went off in my head when I read this section.
Thanks again for your help.

Richard Dooling

Richard Dooling
Sunday, April 13, 2003

I'm glad I provided some illumination! :-)

Darren Collins
Sunday, April 13, 2003

*  Recent Topics

*  Fog Creek Home