Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips


How about a scripting tag that will return the number of articles like..
{$ getcount (condition) $}

condition would be just like in the foreach tag

That way we can get the number of all articles, the new ones, in a specific folder etc.

Is there another way to do this currently?

Wednesday, September 11, 2002

interesting :)

Here's an awful idea:

{$ foreach x in (condition) $}1+{$ next $}0</script>

I haven't actually tried it but I'm sure somebody will tell me if it works!

Joel Spolsky
Wednesday, September 11, 2002

Excellent! Here's the one that worked for me

{$ foreach x in (all) $}1+{$ next $}0);</script>

Thank you.

Wednesday, September 11, 2002

Dang Joel, that's truely an original!

Here's an addition that won't spit out crazy looking HTML:

<script language="javascript">
var tmp = "{$ foreach x in (all) $} {$ next $}";

Make sure to include a space between $} {$

Thanks !!

Richard Caetano
Wednesday, September 11, 2002

That's kinda fun, and useful.  But can someone explain how it works?

Joel C. Goldstick
Friday, September 20, 2002

Never mind, I get it.  Cool!

Joel C. Goldstick
Friday, September 20, 2002

*  Recent Topics

*  Fog Creek Home