ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

vCalendar files?

October 24, 2008 2:15pm

Subscribe [4]
  • #1 / Oct 24, 2008 2:15pm

    LostInDaJungle

    5 posts

    I’m setting up an events calendar in EE…

    What I’d like to do is have EE generate .vcs files on the fly so that my users can add the event to their calendaring application with a click.

    This code creates the proper vcs format…

    {exp:weblog:entries weblog="calendar" show_future_entries="yes" dynamic="on" limit="1"}
    BEGIN:VCALENDAR
    PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
    VERSION:1.0
    BEGIN:VEVENT
    DTSTART:{entry_date format='%Y%m%d'}T123000Z
    DTEND:{entry_date format='%Y%m%d'}T210000Z
    LOCATION;ENCODING=QUOTED-PRINTABLE:
    DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{event_body}
    SUMMARY;ENCODING=QUOTED-PRINTABLE:{title}
    PRIORITY:3
    END:VEVENT
    END:VCALENDAR
    {/exp:weblog:entries}

    How do I get this to go to the client as a “.vcs” file? Any help would be appreciated.

  • #2 / Oct 24, 2008 4:02pm

    Ingmar

    29245 posts

    You’ll probably need PHP to set the correct header format. In this case, something like:

    <?php
        header("Content-Type: text/x-vCalendar");
        header("Content-Disposition: inline; filename=MyvCalFile.vcs");
    ?>
  • #3 / Oct 27, 2008 2:44pm

    LostInDaJungle

    5 posts

    Thanks, worked like a champ.

  • #4 / Oct 27, 2008 4:32pm

    Ingmar

    29245 posts

    Very good 😊 Glad to hear it.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases