Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Conditional Display of Folder Names in Index Page

I'm building a knowledge base using CityDesk. There are several subjects and each one has its own folder. I want to create an index page for the entire knowledge base so that the subjects (folder names) are listed as headings and all the article headlines for that subject are listed underneath each heading. How can I make it so that the subject heading doesn't appear if there are no articles for it yet?

John Topley
Thursday, September 05, 2002

If I understand, use an IF statement and check to see if an extra field is empty.  Put "Nothing_in_this_folder" in extra2 of the folder's index article.  You'll have to remove it when something goes in the folder though.

You could do it with keywords as well: Use "empty" as a keyword in the folder's index article and check it with your script.  Once again you'll have to remove the keyword when you finally add something to the folder.

There are probably other ways too:  Don't add an index article to an empty folder.

I get too confused doing "and's," "or's," and "not's" to give you a decent CityScript that gets it done.  Darren and others probably can though and may have better methods too.

tk
Thursday, September 05, 2002

I tend to do what Terry suggested above - don't put index articles in folders that don't have any real articles yet.

Darren Collins
Thursday, September 05, 2002

Or use scripts (more complex, but won't need you keeping of track index files).

The disadvantage of the methods mentioned by tk and darren is that folders won't show up if you didn't set the index publication correctly (either by removing the (empty) keyword or by creating/publishing the index file).

disadvantage of client side scripts is that end users must have them enabled.

Adriaan van den Brand
Friday, September 06, 2002

*  Recent Topics

*  Fog Creek Home