Page 1 of 1

[SOLVED] CGCalendar - view as calendar _and_ list

Posted: Tue Jun 09, 2009 1:15 pm
by vinc
Hi there,

I wish to insert into a page a calendar and the corresponding list of events.

Actually, it is ok to show that. My calendar is showing, and then the list below.

But when the user clic on the '>>' (next month) on the calendar, I want the list to change its month too.
(also when he clic on the link 'next' on the list.)

I don't know how to do this, so if you can help...
PS : sorry for my poor language ;)

Re: CGCalendar - view as calendar _and_ list

Posted: Tue Jun 09, 2009 5:17 pm
by bryan
This can be done by capturing the current month as a variable and using it to display a that month in a list template. Copy/Paste the following code into your calendar template:

Code: Select all

{* List View of Current Month *}
{capture assign='monthnum'}{$event.event_date_start|date_format:"%m"}{/capture}
{cms_module module='CGCalendar' display='list' listtemplate='blog-post-list' month=$monthnum}
You can edit the blog-post-list template as needed or create a new one if you're using it elsewhere already.

Re: CGCalendar - view as calendar _and_ list

Posted: Tue Jun 09, 2009 5:43 pm
by vinc
This does the trick !

Thank you so much !

Re: CGCalendar - view as calendar _and_ list

Posted: Tue Jun 09, 2009 7:40 pm
by bryan
You're welcome.
Remember to add [SOLVED] to the title.