Problems, need help? Have a tip or advice? Post it here.
14 posts Page 2 of 2
This is some awesome support here. KK I am impressed!
* * * * * * I LOVE COUCH CMS - flexible and straight forward * * * * * *
Hi,
I tried following along and still haven't figure it out: I want to have two event listings (no calendar or detail view). Is it possible to show just the next, say, 5 events from today on? How would I show just past or just future events. I think the publishing date is set to the event date?

Thanks
Mark
Hi @superdau,

I think you'll find the following thread useful as it deals with fetching pages based on dates -
viewtopic.php?f=8&t=8316

The solution to your specific problem could be the following (assuming the publish date is set as the event date):
Code: Select all
<!-- set a variable named 'today' with current date in Y-m-d format -->
<cms:set today="<cms:date format='Y-m-d' />" />

<!-- fetch all pages starting from today -->
<cms:pages masterpage='events.php' start_on=today show_future_entries='1'>
    .. data from all regions available here ..
</cms:pages>

<!-- fetch all pages before today -->
<cms:pages masterpage='events.php' stop_before=today>
    .. data from all regions available here ..
</cms:pages>

Hope this helps.
Thanks a lot KK, I'll try that out...
14 posts Page 2 of 2
cron