Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2017-11-08 14:34:27

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

yes, the needed VTIMEBLOCK i do inside the rah_eo_generate-ics now.

Offline

#26 2017-11-08 14:37:10

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

now the .ics file is validated:

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:Führungstermine
PRODID:-//Apple Computer, Inc//iCal 1.5//EN
X-WR-TIMEZONE:Europe/Berlin
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:2017-11-07T23:29:11Z@http://mydomain.de/
DTSTART:20180217T150000
DTEND:20180217T163000
DTSTAMP:20171108T002911Z
SUMMARY:Sa, 17.02.2018
END:VEVENT
END:VCALENDAR

But still empty in my calendar….

Last edited by lythande (2017-11-08 14:37:24)

Offline

#27 2017-11-08 14:45:39

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,754
Website

Re: Outputting a valid .ics file from an Event for download

It’s working for me:

I tried it on your test domain (which you’ve now edited out) and clicking on “download ics file” creates an invite.ics and immediately the mac calendar pops up and asks which calendar I want to add it to. I chose “private” and it appeared correctly at the right place in my calendar.

I also tried creating ics files from your code blocks above with a text editor and then double-clicking on them to open them in the mac calendar and that worked too (also with blank lines in front).


TXP Builders – finely-crafted code, design and txp

Offline

#28 2017-11-08 14:51:37

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

hmmm, why doesnt work on my mac? :-(
I have Mountain Lion 10.8.5 and not problems to get another .ics-files in my calendar.

Offline

#29 2017-11-08 14:58:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,754
Website

Re: Outputting a valid .ics file from an Event for download

Hmm, I’m on the most recent macOS. Can you compare your generated ics-file against an ics file that works? Maybe you can identify relevant differences…

See also this thread which suggests that if you add METHOD:PUBLISH underneath the PRODID line, you may also get the request to choose your calendar in Mountain Lion.


TXP Builders – finely-crafted code, design and txp

Offline

#30 2017-11-08 15:36:21

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

Okay, I have a ics-file, that works and compare it with my ics-file. So I see some differences and have solved it.
But its still doesnt work on my mac…

Here my new .ics-file:


BEGIN:VCALENDAR
VERSION:2.0
X-LOTUS-CHARSET:UTF-8
X-WR-CALNAME:Führungstermine
PRODID:http://my-domain.de
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:2017-11-07T23:29:11Z@http://mydomain.de/
CLASS:PUBLISH
ORGANIZER:
SUMMARY:Sa, 17.02.2018
DTSTART;TZID=Europe/Berlin:20180217T150000
DTEND;TZID=Europe/Berlin:20180217T163000
DTSTAMP:20171108T002911Z
LOCATION:Bundeskunsthalle Bonn
COMMENT:
DESCRIPTION:(Beschreibungstext des Artikels)
END:VEVENT
END:VCALENDAR

and here a .ics-file from the german train:

BEGIN:VCALENDAR
VERSION:2.0
X-LOTUS-CHARSET:UTF-8
PRODID:http://www.hacon.de
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:20171111082300@hafas
CLASS:PUBLIC
SUMMARY:Kassel Hbf -> Marburg(Lahn)
DTSTART;TZID=Europe/Berlin:20171111T082300
DTEND;TZID=Europe/Berlin:20171111T093300
DTSTAMP:20171108T162100Z
DESCRIPTION:Reise: Kassel Hbf nach Marburg(Lahn)\nDatum: 11.11.17\n-\nab 08:23 Kassel Hbf - Gleis 7 (RE  4155)\nan 09:33 Marburg(Lahn) - Gleis 4\n-\nDauer: 1:10 \n\nAlle Angaben ohne Gewähr. Fahrplanänderungen vorbehalten. Bitte prüfen Sie kurz vor der Reise den aktuellen Fahrplan unter: www.bahn.de\n 
END:VEVENT
END:VCALENDAR

Last edited by lythande (2017-11-08 15:36:51)

Offline

#31 2017-11-08 16:13:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,754
Website

Re: Outputting a valid .ics file from an Event for download

I sent you a couple of further ideas to try out in reply to your email.


TXP Builders – finely-crafted code, design and txp

Offline

#32 2017-11-08 17:45:31

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

Much thanks for supporting by Email!
Now works!!! :-)

How I solve it:

1. Create an Event in my own Calendar with all Information, what I do have wish inside. (URL, Description…)

2. Drop this Event to Desktop or in a File. Open it with a Texteditor.

3. Compare the calendar-Event with the forms icsitem and rah_eo_generate-ics.

I have compare both and have seen, that my text was in wrong order. After I corrected the order, it works! :-)

I have made two new custom_fields, because one for the url to the long article and another with the right Title for the calendar (and not the title from article).

Here is my .ics-file:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//Mac OS X 10.8.5//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
DTSTART:19700329T020000
TZNAME:MEZ
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
DTSTART:19701025T030000
TZNAME:MEZ
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20171108T002911Z
UID:2017-11-07T23:29:11Z@http://mydomain.de/
DTEND;TZID=Europe/Berlin:20180217T163000
TRANSP:OPAQUE
SUMMARY:(Title for Calendar)
DTSTART;TZID=Europe/Berlin:20180217T150000
DTSTAMP:20171108T002911Z
LOCATION:Bundeskunsthalle Bonn
DESCRIPTION:Teilnahme nur nach Anmeldung bis 3 Tage vorher möglich!
URL;VALUE=URI:http://mydomain.de/url...
END:VEVENT
END:VCALENDAR

Offline

#33 2017-11-08 18:29:38

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

Hm, it works with more Event-Articles too. But: the .ics-file contains all events and not the one from the one article. So the download is for all articles.
How I can create, that both article have two different .ics-files, one .ics for a single article?

Sure, I wish to have a .ics-File with all events too, thats no problem! :-)
But maybe the .ics-file is different between two languages in the event, so that one .ics is with english-events and the other .ics with german-events.
I think, I must work with a 3rd category for say, in which language is the event. I using the category2 to choose the language.

Last edited by lythande (2017-11-08 20:15:58)

Offline

#34 2017-11-10 19:53:21

lythande
Member
Registered: 2009-09-08
Posts: 202
Website

Re: Outputting a valid .ics file from an Event for download

Much thanks Jakob! Now I can output in a .ics: single event, all event, and all events from each language!
Now works, thanks a lot! :-)

Offline

#35 2017-11-15 09:54:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,754
Website

Re: Outputting a valid .ics file from an Event for download

colak wrote #307686:

this would be an excellent howto for txptips …

I’ve written this up now as a txptip, and tried to generalise the situation a little:

» Outputting an .ics calendar file from a Textpattern article

Thanks to lythande for her help and for providing me with her setup to test it. We’ve not yet tried how it works with different calendar apps and OSes, so any feedback for improving the .ics output would be helpful. Finally, I hope the tutorial is useful :-)


TXP Builders – finely-crafted code, design and txp

Offline

#36 2017-11-15 14:37:14

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Outputting a valid .ics file from an Event for download

Thanks to jakob for the excellent tutorial, and hope it benefits some members of the community! Textpattern Tips is always open for new and exciting content, keep it coming :)

Offline

Board footer

Powered by FluxBB