Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Display returned set groupedby month on date field


Go to End


3 Posts   1708 Views

Avatar
LesC

Community Member, 70 Posts

17 November 2009 at 6:34am

I'm trying to get a page to display items grouped by their date field, so that I get something like:

JANUARY 2010
Item title
Item title

MARCH 2010
Item title

APRIL 2010
Item title
Item title

Do I need to do this in the template, or in the query that I run?

Cheers

L

Avatar
Willr

Forum Moderator, 5523 Posts

17 November 2009 at 3:30pm

You will need to do this in the query. The template parser is probably not smart enough to handle doing that nicely.

Avatar
LesC

Community Member, 70 Posts

18 November 2009 at 12:46am

OK, I'll ask the question in the DataModel forum then. Thanks Will.