CGCalendar: possible to display all events?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Cerulean
Forum Members
Forum Members
Posts: 172
Joined: Mon Nov 01, 2010 8:56 am

CGCalendar: possible to display all events?

Post by Cerulean »

Looking at the parameters for CGCalendar, I can't see a way to display a list of all events. There are options for listing past events, upcoming events, or events for a given year, but no option to simply display all events.

Any suggestions?
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: CGCalendar: possible to display all events?

Post by paulbaker »

Cerulean wrote:Any suggestions?
2 calls on one page? Past events, and then upcoming events.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Cerulean
Forum Members
Forum Members
Posts: 172
Joined: Mon Nov 01, 2010 8:56 am

Re: CGCalendar: possible to display all events?

Post by Cerulean »

Thanks for the reply.
paulbaker wrote:2 calls on one page?
Yes, I think that will be the only way.

Thinking that it would be good to merge the event arrays from the two module calls so a single foreach loop can be used, I came up with the following...

In the CGCalendar template for the first module call (pastlist):

Code: Select all

{$merged_events = $events}
In the CGCalendar template for the second module call (upcominglist):

Code: Select all

{foreach $merged_events|@array_merge:$events as $key=>$event}
...
{/foreach}
There might be better ways to do this, but this method worked okay for me.
Post Reply

Return to “Modules/Add-Ons”