locomotivecms/engine — pull request #457 by markwpearce (2012-07-05 20:28:52+00:00)
Title: Enables group_by_<belongs_to field> in liquid

This allows you to do a "group by" in liquid for a "belongs to" field.

For Example: if you have models "Movies" belongs to "Director", you can write code like this:

``` liquid
{%for group in contents.movies.group_by_director %}
{{group.name}} has {{group.entries.size}} movies:
{%for movie in group.entries%}
{{movie.name}} -
{%endfor%}

{%endfor%}
```

to give something like:

Hitchcock has 3 movies : Birds - Psycho - Rear Window -
Spielberg has 4 movies : ET - Raiders of the Lost Ark - Jaws - Saving Private Ryan -