Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

How-to select folder and not "keyword"?

I'm having trouble writing a litte script and need some help.

The logic is:
List all the articles in the folder "IssueFolder" except the articles with the keyword "wholelist"

In English: I want to list all of the articles and a folder that don't have  the keyword, "wholelist."

The parentheses are confusing me.

Terry Kearns
Tuesday, November 27, 2001

{$ foreach article in (and (folder "IssueFolder") (not (keyword_contains "wholelist"))) $}

Michael Pryor
Tuesday, November 27, 2001

Here is the loop:

{{$ foreach x in (and (folder "IssueFolder") (not (keyword_contains "wholelist"))) $}
{$x.headline$}
{$x.body$}
{$next$}

Here is the page it produced:
http://tk-jk.net/coit/IssueFolder/fog0000000046.html

I'm not sure where the spare "{" right below the publish date came from.

Scroll down to "Immigration" and it single spaces between the headline and body for several articles and goes back to double space after that.  I'm not sure what I did to cause that.

Terry Kearns
Tuesday, November 27, 2001

You wrote:

"Here is the loop:

{{$ foreach x in (and (folder "IssueFolder") (not (keyword_contains "wholelist"))) $}"

the extra '{' comes from right before the foreach clause, you typed {{$ foreach instead of {$ foreach.

the spacing probably has to do with <P> tags in your html code.

Michael Pryor
Tuesday, November 27, 2001

All fixed, thanks.

The single-double space was caused by extra "<P>'s" that I found in the HTML.  I guess this resulted from pasting the text from various sources.  In WYSIWYG mode, all the articles look the same.  A WYSIWYG person would never know.

Terry Kearns
Tuesday, November 27, 2001

*  Recent Topics

*  Fog Creek Home