Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Script for "thisFolder"

I'd like to write a script in a template that lists all the files in the folder in which the article is saved. It might look like this if the condition thisFolder exisited: {$ foreach x in (folder "thisFolder") $}

Can anyone help a scripting newbie?

Andrew Scott
Wednesday, April 17, 2002

Lots of people would like to do that.  There has been talk about putting that in a version 2.  For now you have to write the name of the folder in the condition.  See script examples written on Terry's and Darren's sites (left sidebar has links)

Joel Goldstick
Wednesday, April 17, 2002

This is one of my magic bullets because it can make a routine script portable.  When (I hope) we get this kiind of feature, we can put a routine CityScript into a variable to save some time and mistakes.

I suspect the ultimate solution will be more clever than I can think of right now.

tk
Wednesday, April 17, 2002

What I'd love to see is a truly intelligent nested navigation...

>BROAD SECTION 1
>BROAD SECTION 2
>BROAD SECTION 3
-BROAD SECTION 4
+sub nav 1
+sub nav 2
+SUB NAV 3
+sub nav 4
>BROAD SECTION 5

Where you're located in "home / broad section 3 / sub nav 3."

The navigation expands "Broad Section 4" because you're in it, and bold's "Sub Nav 3" without linking it, because that's where you are. AND the breadcrumb trails are built for you. If CityDesk could do that I'd believe there wasn't someone standing there in that grassy knoll.

(I know nothing about kennedy conspiracy theory, so if that wasn't a magic bullet reference, forgive me.)

Mark W
Wednesday, April 17, 2002

I use the following in one of my templates:

{$ foreach x in (folder "\") $}
  stuff to do something useful for each item
{$ next $}

Perhaps something like,

{$ foreach x in (folder ".\") $}

Rod

Rod Kratochwill
Thursday, April 25, 2002

*  Recent Topics

*  Fog Creek Home