0

I have an event calendar page:

site.com/events/event-calendar

that lists all upcoming events on that one page. Next to each event listing i want there to be an 'Export' button that links to/exports the ics for just that one individual event.

My export button currently links to the 'export' template - a href="export" - with:

{exp:calendar:icalendar 
    show_days="1"
    limit="1"
    dynamic="off"}
{/exp:calendar:icalendar}

but that does not export the ics for the exact event. I have tried playing around with the parameters date_range_start, date_range_end, event_id but can not get it to work. Is it even possible? What do i need to add?

Any help is appreciated!

1

You will want to change your template up

Export Template:
URL: http://mysite.com/events/export

{exp:calendar:icalendar
    event_id="{segment_3}" 
    limit="1"
}
{/exp:calendar:icalendar}

Main Template
URL: http://mysite.com/events/event-calendar

<h1> Events</h1>
{exp:calendar:events}
    <h2>{event_title}</h2>
    ... Additional Data here...
    <a href="/events/export/{event_id}">Download</a>
{/exp:calendar:events}

This will pass the event_id to your export template properly for each event. As Solspace mentioned in the comments this will export all occurrence for the event not just a single occurrence of that event.

| improve this answer | |
  • Note: this would export all of the event data for a particular event entry. In other words, it exports the event entry, not a specific occurrence (it doesn't restrict by a set timeframe). – Solspace Jun 27 '14 at 2:59
  • That is a very good point. I have edited my answer to include that. – Justin Long Jun 27 '14 at 11:47
  • @ZEDG if you need single occurrences let me know and I will edit my answer. – Justin Long Jun 27 '14 at 11:50
  • Additional queries: 1. Is there a way to specify the 'time' of the event (within the exported ics) to be an 'all day event'? (ALL events are only date specific, the time of day is not relevant.) 2. Can the ics file accommodate custom field entry info? (There are custom fields for 'contact name/phone/email'.) It would be good is this extra info could appear in the (ics) summary. – ZEDG Jun 30 '14 at 4:28
  • You would mark your event as "All Day" in the "Calendar: Events" entry, and your exported events should be marked as "All Day". Unfortunately, .ics file doesn't export custom field data. – Solspace Jun 30 '14 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.