evanmiller/erlydtl — pull request #24 by thge (2012-05-07 08:35:52+00:00)
Title: Extended {%ifchanged %} syntax to accept parameters

Django ifchanged can accept parameters, so it is possible to check for a value
which does not appear in output. Django documentation says to support one or
more parameters, this implementation supports up to 4 paramters (only limited
by the parser expression, this can be improved to support even more
parameters when needed).

{% for date in list %}
{% ifchanged date.month %}
{{ date.month }}:{{ date.day }}
{% else %}
{{ date.day }}
{% endifchanged %}
{% endfor %}

See erlydtl_unittests for some other examples.

The other (Django) syntax to use {% ifchanged %} without parameter works like before.