Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Sub folders.

Given the fact that one can have BreadCrumbs. Is it Possible be able to list all sub folders.

So that a standard template would be able to do.

<!-- List sub folders -->
{$foreach f in ( and (isFolder)), (thisFolder)$}
    <a href="{$$}"></a>
<!-- List Articles -->
{$foreach x in (thisFolder)$}
  <a href="{$$}">(more)</a>

Apologies on the (ab)use of syntax.

The idea being that a standard type of template could be used which does the right thing for trees.

Monday, September 22, 2003

Currently, you can only loop over articles. You can't loop over folders or non-article files.

But here's a workaround (if I understand your problem correctly):

I make sure I've got an article named 'index' in every folder in my site. Each of these articles has a proper name entered in the Title field. Then you can do a loop over all articles named 'index', using their Titles as the link text, to build a kind of navigation menu. This is also nice because people trying to backtrack up a URL by chopping off the rightmost folder will always find an 'index.html' file instead of a 'Permission Denied' error.

You could use keywords to do the same sort of thing if you want to use different article names or don't want to be restricted to your site's folder structure.

Darren Collins
Thursday, September 25, 2003

*  Recent Topics

*  Fog Creek Home