Generate ICS Files

1.0.7 2023-08-02 10:29 UTC

This package is auto-updated.

Last update: 2024-07-10 10:03:19 UTC


Release Downloads Build Status Coverage Status Maintainability Twitter

Generate ICS Files.

Commerical Usage

Support open source!

This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?

Be kind. Share a little. Thanks.

‐ Bruno


  • unzip as folder site/plugins/kirby3-ics or
  • git submodule add site/plugins/kirby3-ics or
  • composer require bnomei/kirby3-ics


Plain PHP

// automatic id
$ics = new \Bnomei\ICS();
$id = $ics->id();

// or use custom id
$id = sha1('myUniqueID');

// provide custom options
$ics = new \Bnomei\ICS([
    Vcalendar::UNIQUE_ID => $id,

// maybe reuse a static object identified by id
// otherwise it will be created now
$ics = \Bnomei\ICS::createOrLoad($id);

// get Vcalendar object...
$vcalendar = $ics->vcalendar();
// ... apply your ics data (see docs of lib)
// then retrieve the ics string
echo $ics;

Page Method

Use the ics()->vcalendar()-method to retrieve the Vcalender Object then add properties, events and alarms. Please read the original docs of used lib for an overview about what is possible.


$vcalendar = $page->ics()->vcalendar();

$vcalendar->setXprop(Vcalendar::X_WR_CALDESC, "This is a demo calendar");

$event1 = $vcalendar->newVevent()
    ->setTransp( Vcalendar::OPAQUE )
    ->setClass( Vcalendar::P_BLIC )
    ->setSequence( 1 )
    // describe the event
    ->setSummary( 'Scheduled meeting with five occurrences' )
         'Agenda for the the meeting...',
         [ Vcalendar::ALTREP => 
             'CID:<>' ]
    ->setComment( 'It\'s going to be fun..' )
    // place the event
    ->setLocation( 'Kafé Ekorren Stockholm' )
    ->setGeo( '59.32206', '18.12485' )
    // set the time
        new DateTime(
            new DateTimezone( 'Europe/Stockholm' )
        new DateTime(
            new DateTimezone( 'Europe/Stockholm' )

echo $page->ics();

TIP: You can retrieve the static unique object for a page using the page method $page->ics(). This makes it possible to prepare the ICS in a page model or page controller and just display the data in your template or content representation. Check out the tests for an example.

Content Representations

Assuming you prepared your ics data in a model or controller your content representation could be as short as this example.


    $page->slug() . '.ics'



This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.



It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


based on V2 versions of