Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Is a folder a topic ???

I'm a bit baffled but looking for an undocumented (AFAICT) feature that may exist. The following script will create a Topic folder in a TOC file for HTML-Help WorkShop. I'm fairly certain I copied it from the CD HTML-Help template - although, I believe the template has changed and uses 'if keyword_contains foo' now, no matter this script works and I don't know why. You see "What's New" is actually a folder called "What's_New".

{$ foreach topic in (filename "What's New") $}
<LI><OBJECT type="text/sitemap">
<param name="Name" value="{$ topic.headline $}">
<param name="Local" value="{$ $}"></OBJECT>

From CD help; (fileName "name") - Returns all articles with a given name.

If you could explain how I'm getting the headline and link properties, without setting them, for a folder (or is it an article) I'd appreciate it.
If you could tell me what other properties a folder has to offer I'd appreciate it.

Now. If I use 'foreach x in all' or even 'foreach x in (folder "foldername") do the folders or sub-folders come up in the loop as x? Is there any way to identify them as folders? I'm hoping so.

Finally, how does it get from "What's_New" to "What's New" and still have CD know what I'm referencing?

Confused in BC

Saturday, July 19, 2003

Folders are never a part of the results of a {$ forEach $} loop, no matter what. The loop only happens for articles which match the condition.

I'm guessing that you have an article with the same name as your folder somewhere.

Joel Spolsky
Saturday, July 19, 2003

I have an entire folder of Intro_Page articles. I was desperately looking for some way to access folder names in script - so I guess I just saw what I wanted to see. Gosh don't I feel... It was late.
Thanx Joel

Saturday, July 19, 2003

*  Recent Topics

*  Fog Creek Home