CGCalendar + ical feed
Posted: Mon May 09, 2016 8:05 pm
I tried to search if it would be possible to subscribe CGCalendar events somehow, but I couldn't find any solution. So I ended up doing it with templates.
1. Create a template of type "CGCalendar::Event List View" and paste following code to it
2. Create an empty template of type "Core::Page" with just code
3. Create a page that is not shown in menu and is using your empty template. Disable WYSIWYG from that page and use code similar to this
4. You can set custom url for the page, e.g. "events.ics" and start sharing that link.
Quick and dirty, but it works
1. Create a template of type "CGCalendar::Event List View" and paste following code to it
Code: Select all
{assign date_format "%Y%m%dT%H%M%S"}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:set some id in here
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:CGCalendar feed
{foreach from=$events key=key item=event}
BEGIN:VEVENT
DTSTAMP:{$event.event_date_start|date_format:$date_format}Z
UID:my_event_{$event.event_id}
DTSTART:{$event.event_date_start|date_format:$date_format}
{if $event.event_date_end}
DTEND:{$event.event_date_end|date_format:$date_format}
{/if}
CREATED:{$event.event_create_date|date_format:$date_format}
LAST-MODIFIED:{$event.event_modified_date|date_format:$date_format}
SUMMARY:{$event.event_title}
END:VEVENT
{/foreach}
END:VCALENDAR
Code: Select all
{content}
Code: Select all
{cms_module module="CGCalendar" display="list" listtemplate="name of template created on step 1"}
Quick and dirty, but it works