Clive Portman: code

Show current, future and past events within Craft CMS

Current events:
{% set currentEvents = craft.entries.section('Events').startDate('<= '~now).endDate('>= '~now) %}
{% for currentEvent in currentEvents %}
	{{ currentEvent.title }}
{% endfor %}

Future events:
{% set futureEvents = craft.entries.section('Events').startDate('>= '~now) %}
{% for futureEvent in futureEvents %}
	{{ futureEvent.title }}
{% endfor %}

Past events:
{% set pastEvents = craft.entries.section('Events').startDate('< '~now) %}
{% for pastEvent in pastEvents %}
	{{ pastEvent.title }}
{% endfor %}