I would like to able to loop through past events in a template:
{% for page in m.search[{past cat='event'}] %}
{% if forloop.first %}<ul>{% endif %}
<h2>{{ m.rsc[page].date_start|date:"M j, Y" }} {{ m.rsc[page].title }}</h2>
<p>{{ m.rsc[page].body|show_media }}</p>
<p><a href="{{ m.rsc[page].website }}">Register to attend this event.</a></p>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}
Basically I am looking for a past search type that acts as the opposite of the upcoming search type.
I already can get upcoming events as follows:
{% for page in m.search[{upcoming cat='event'}] %}
{% if forloop.first %}<ul>{% endif %}
<h2>{{ m.rsc[page].date_start|date:"M j, Y" }} {{ m.rsc[page].title }}</h2>
<p>{{ m.rsc[page].body|show_media }}</p>
<p><a href="{{ m.rsc[page].website }}">Register to attend this event.</a></p>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}
I have no qualms coding this if I am pointed in the right direction and I will contribute the result back to the master code base.
How do you loop through past items in a search in a Zotonic template?