Skip to main content
3 of 3
deleted 11 characters in body
carlcs
  • 36.3k
  • 5
  • 63
  • 140

When you are setting nextEvent, you can limit only events that are upcoming and only output the first result you get back like so:

.startDate('>= ' ~ now).first()

So you can take that and update your code like so:

{% set nextEvent = craft.entries.section('events').order('startDate').startDate('>= ' ~ now).first() %}

{% if nextEvent %}
    foo
{% endif %}

I have assumed you have a section called 'Event's until we get some clarification as to what craft.events.events is.

Jamie Wade
  • 3.6k
  • 2
  • 17
  • 32