Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Invalid CityDesk syntax?

I'm new to CityDesk and so am probably missing something pretty obvious here, but I'm having a problem.  I assume this is happening in the foreach loop I've tried to incorporate in one of my templates.  (I want the template to list the articles in the folder that goes with the template; essentially I'm trying to create a side navbar.)

This is the loop from the template:
{$foreach x in (folder "company")$}
// do stuff with x
{$next$}

And here's the error I get when I press "preview":
Invalid CityDesk Syntax (\company\index(company):942)

If I remove the loop, preview "compiles" just fine.  Is it not possible to use loops in the templates?

Jen Clifford
Wednesday, June 12, 2002

Although it seems I'm now getting the same error in an article where I try to use a similar loop, so I must be doing something wrong.

Jen Clifford
Wednesday, June 12, 2002

No error in the foreach statement...

what's the "// do stuff with x" part?  the error is probably in there somewhere...

Michael H. Pryor
Wednesday, June 12, 2002

I think I must have been forgetting a $ somewhere.  I deleted the loop, started over, and it works now.  Tired eyes, I guess!  Thanks.

Jen Clifford
Wednesday, June 12, 2002

*  Recent Topics

*  Fog Creek Home