Hi Probably a bit of a basic question but I am fairly new to expression and am trying to only display 3 records within a condition and limit or count dont work for this. My code is
{exp:channel:entries channel="events" dynamic = "0" orderby="date_from" sort="asc" }
{if date_from > current_time}
show record
{/if}
{/exp}However if I use this the code shows 6 current records as there are 6 future dates. However I want only to display the 3 nearest upcoming events and limit wont work nor will count as not the first three records. Would normally use i++ to count up but not sure how this works in EE. Any ideas how to add a counter to pick 3 events and then stop Thanks
I believe you can use start_on="tomorrow" along with limit. This will only list entries that are dated for tomorrow or later. https://docs.expressionengine.com/latest/channels/entries.html#start_on
{exp:channel:entries channel="events" dynamic = "0" orderby="date_from" sort="asc" start_on="tomorrow" show_future_entries="yes" limit="3" }
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.