Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Building a complete file tree with cdscript

I've been trying to build a complete menu tree.  I've stumbled

This shows all the index files and includes the folder they are in (I put it in extra1)

<h3>All index files -- all directories </h3>
{$foreach x in (and(filename "index")(all))$}
<li>{$ x.filename $} - {$x.headline$}::{$x.Extra1$}</li>

But then I tried to insert another foreach loop inside this one using

    {$ if nonblank x.Extra1 $}
      Extra1 is "{$x.Extra1$}"
    {$foreach y in (and (folder "{$x.Extra1$}") (not( filename "index")))$}
      <li>{$ y.filename $} - {$y.headline$} in directory: {$y.Extra1$}</li>
    {$ endIf $}

This won't build.  I guess you can't use a cd variable in a folder statement.

Any other ideas about how to build this with just CD.  I know it can be done with Server side or Javascript, but I'd like to do it with CD if possible

Joel Goldstick
Monday, June 16, 2003

CityScript in its current incarnation will only handle the simplest of tasks.  Support for doing recursive and nested stuff does not exist. 

David Burch
Monday, June 16, 2003

*  Recent Topics

*  Fog Creek Home