Page 1 of 1

Calendar module: Post past events only if no upcoming events

Posted: Wed Aug 26, 2009 6:32 pm
by nncreativecity
I'm using the calendar module to post events on a site. I want three upcoming events to post on my homepage. However, if there are no upcoming events, I'd like to display the three most recent events. I can figure out how to post both 3 upcoming events and 3 past events all the time, but not how to use an if clause. It seems the only way to post upcoming and past is to call the calendar module twice ... like so.

{cms_module module="Calendar" display="upcominglist" upcominglisttemplate="home" limit=3}
{cms_module module="Calendar" display="pastlist" upcominglisttemplate="home" reverse="true" limit=3}

Any help on this would be appreciated.

Thanks.

Natalie

Re: Calendar module: Post past events only if no upcoming events

Posted: Tue Jan 12, 2010 1:53 pm
by clemmy
in the wiki, in the share your tag page, there is an example called "count news items"

I think you can make a similar tag to count upcoming events.. and then you can build the if clause..