I'm trying to add an export function to my calendar that will export a single event.

When I use the example code, it exports my entire calendar.

I tried passing a single event using this code:

{% set events = craft.calendar.event(craft.request.getSegment(3), ({
    loadOccurrences: false 
})) %}

{{ craft.calendar.export(events) }}

and I get this error:

Argument 1 passed to Calendar\Library\Export\AbstractExportCalendar::__construct() must be an instance of Calendar\Library\Events\EventList, instance of Calendar\Library\Events\Event given, called in /craft/plugins/calendar/variables/CalendarVariable.php on line 128 and defined

Is there a way to export only individual events?


There's a definitely a syntax error in your first line.

    loadOccurrences: false

should be:

    loadOccurrences: false

Also, from their docs, the export method only shows one parameter being passed in and you've specified two.

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.