Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Foreach by date?

Im sure this has been asked, but, is there a way to loop through articles by date? What i'd like is the traditional weblog type format:

Date
  Article 1
  Article 2
  Article 3

Date
  Article 4

etc..

Suggestions?

Steve M
Wednesday, September 11, 2002

You should give the template by John C a look at:
http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=4121&ixReplies=6

It might give you some ideas if you haven't looked at it already.  I think it might be close you what you are looking for.

tk
Wednesday, September 11, 2002

Basically what you want is

{$ forEach x in (folder "news") sortDescendBy .filedDate $}
{$ x.filedDate $}
{$ x.body $}
{$ next $}

plus some formatting.

From my experience blogging I would highly recommend using one article per day instead of one article per tidbit, it's much more manageable. But if you want to have one article per tidbit and you only want one slug per day, you can do this by typing the date yourself into the headline of the top tidbit, leaving the other headlines blank, then do this:

{$ forEach x in (folder "news") sortDescendBy .filedDate $}
{$ if nonBlank .headline$}{$ x.headline$}{$ endIf $}
{$ x.body $}
{$ next $}

Hope that helps!

Joel Spolsky
Thursday, September 12, 2002

Great! Thanks!

Steve M
Thursday, September 12, 2002

*  Recent Topics

*  Fog Creek Home