Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Looping

Is there any way to make CD return a list of folders, rather than pages?

I was trying to make a menu system that would cope with folders and sub folders. But it seems you need to make a new menu for every sub-folder on your site, which makes for a lot of editing if new folders are created.

e.g on the left side of my page template I made a column for the menu

At the site root
ARTICLES
DOWNLOADS
BLAH BLAH

then inside the articles folder
ARTICLES
--- SUB FOLDER
--- SUB FOLDER
DOWNLOADS
BLAH BLAH

The normal for... next loops are used to generate lists of documents inside the individual folders. But it means that if one folder changes, you have to manually change every menu instance that could be affected.

Am I missing the obvious?

Ashley Dennison
Wednesday, February 25, 2004

You can control this a little better with keywords, or loops that will index all subfolders of a given folder (but won't list them as seperate items).

By using keywords you can also change the category of an article without moving it (and breaking links to it from other places like search engines).

Good luck.

www.MarkTAW.com
Wednesday, February 25, 2004

*  Recent Topics

*  Fog Creek Home