• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CGCalendar + ical feed
PostPosted: Mon May 09, 2016 8:05 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Tue Feb 15, 2011 8:44 am
Posts: 38
Location: Helsinki, Finland
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
Code:
{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


2. Create an empty template of type "Core::Page" with just code
Code:
{content}


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
Code:
{cms_module module="CGCalendar" display="list" listtemplate="name of template created on step 1"}


4. You can set custom url for the page, e.g. "events.ics" and start sharing that link.

Quick and dirty, but it works :)


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGCalendar + ical feed
PostPosted: Tue May 10, 2016 2:42 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2970
Location: The Netherlands
Thanks for sharing!

I'm not sure whether the DTSTAMP is used properly.

Further I think DTSTART end DTEND should contain time zone information. Though it might seem to work when only used by locals (people in the same time zone). When sharing event information across time zones I expect current implementation to fail.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGCalendar + ical feed
PostPosted: Fri May 13, 2016 5:51 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Tue Feb 15, 2011 8:44 am
Posts: 38
Location: Helsinki, Finland
velden wrote:
I'm not sure whether the DTSTAMP is used properly.

Further I think DTSTART end DTEND should contain time zone information. Though it might seem to work when only used by locals (people in the same time zone). When sharing event information across time zones I expect current implementation to fail.


You might be correct, I'm not too familiar with the specs and I pretty much copied this from google's feed. All fixes and improvements are very welcome :)


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
A2 Hosting