Automatically create .ics file so users can 'Download to calendar'


#1

Matrix Version: 5.5.1.3

I have an asset listing page showing Calendar Event assets that works well. When a user clicks on an event to view its details, I would like that page to include a ‘Download to Calendar’ link that downloads an .ics file. I have looked through the forum and manuals and I couldn’t find anything that shows me exactly how to download an individual .ics file. A lot of the info is also quite old.

I have seen this in action on other matrix sites so I know its definitely possible. I think it has something to do with creating a special design, a paint layout, use ‘BEGIN:VCALENDAR…’ etc but I don’t know how to put all of it together without a bit of help.

Does anyone have a link to a complete tutorial or can provide the full steps I need to follow to have a ‘download .ics’ link on the Calendar Event page?

Thanks


(Nic Hubbard) #2

You need to create a new Design asset with the following:

<MySource_PRINT id_name=“global” var=“content_type” content_type=“text/calendar; charset=UTF-8” />
<MySource_area id_name=“body” design_area=“body” />

Then add that to your calendar pages as a user defined design which you can then call on the page using something like:

www.mysite.com/event?SQ_DESIGN_NAME=calendar

That is how we do it on the PUC website: https://www.puc.edu/calendar