Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Will either of these work?

{$ foreach s in (folder "Corporate/sections") $}
<p>s.headline = {$s.headline$}<br>
{$ foreach 3 x in (keyword_contains "{$s.headline$}") $}
x.headline = {$ x.headline $}</p>
{$ next $}
{$ next $}

{$ foreach s in (folder "Corporate/sections") $}
<p>s.headline = {$s.headline$}<br>
{$ foreach 3 x in (keyword_contains "Corporate{$s.headline$}") $}
x.headline = {$ x.headline $}</p>
{$ next $}
{$ next $}

I'd prefer it if the second one worked, but either one. Can I put a loop variable inside a foreach condition?

Austin Ziegler
Saturday, February 02, 2002

May I ask what these scripts are designed to do if they actually work?

tk
Saturday, February 02, 2002

I recently tried a similar thing and it didnt'work.

Basically what he's tryin to do (if I understand) is something just like in the following thread:

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

Folder 1
- article 1a
- article 1b
Folder 2
- article 2a
- article 2b

etc.

I bet something like this could be done with some serious javascripting (variables and arrays and such) but it seems like an often-requested-enough feature by now.

Mark W
Saturday, February 02, 2002

Very simply, I have a list of sections. These sections are in a folder called Corporate/Sections; the sections are articles -- they are also folders under Corporate.

Thus, I might have an article with the headline /news; the full path to an article within that section would be Corporate/news. Thus, I'm trying to go through the articles in Corporate/Sections and build the names of the sections -- and the folder that they are in.

I'm not even sure that the first example will work, where I put the section name (e.g., "/news") in the keywords field.

-austin

Austin Ziegler
Saturday, February 02, 2002

To my knowledge nested loops don't work in this release.

Mark W
Saturday, February 02, 2002

I think that nested loops will work; what I'm not sure of is whether or not you can use the results of one loop in another.

Austin Ziegler
Sunday, February 03, 2002

Right, you can't use the results of one loop in another.

Joel Spolsky
Monday, February 04, 2002

*  Recent Topics

*  Fog Creek Home