I have this code which filters a list of conferences and returns only those which haven’t already finished. It works fine:
<ul>
{exp:channel:entries channel="conference" sort="asc" orderby="conference_start_date"}
{if "{conference_end_date}" >= "{current_time}"}
<li>
<a href="http://{title_permalink=conferences/conference}">{title}</a>
</li>
{/if}
{/exp:channel:entries}
</ul>The problem is I want to only display the first entry on this list (i.e. the event which ends soonest). Because the channel entries are being parsed before the if statement runs, using limit=“1” results in no entries. Is there a way around this? Using the entry date for the start date won’t work, as these entries are created and used long before the conferences actually start. Similarly, changing the status to closed won’t work because these pages are used after the conference has ended. Any ideas?