I'm working for this nightclub and are currently making a website for them, they've got lots events and their site is built a lot around events, today they make an facebook event of every event but it would be killer to have a "Add to my Calendar" button which added it to your iCal or Google Calendar (or maybe even Outlook).
I've managed to figure out how to make an calendar feed but then it will be added as a new calendar, only good thing is that people can "subscribe to events" but it's quite messy to have an calendar for every event. So I would like to know how to implement a function which lets them add it to their main calendar easily. Think like a mailto: link but for calendars if that's possible.
Also while I'm on the subject, does anyone know if it's possible to automatically import an event from Facebook to WordPress or export an event from WordPress to Facebook that would be great, but that's not so important.
Open the Calendars.Net site in your Web browser (link in Resources), and then click the "Create Free Calendar" link. Click the "Create at Calendars.NET" link on the next screen, and then enter a file name, title and description on the subsequent page's form.
Open your Google Calendar and select the event you want to share. Click the three dots to open the option menu. Click “Publish event” Copy the URL and paste the link on any platform you want.
The links in Dave's post are great. Just to put a few technical details about the google links into an answer here on SO:
Google Calendar Link
<a href="http://www.google.com/calendar/event?action=TEMPLATE&text=Example%20Event&dates=20131124T010000Z/20131124T020000Z&details=Event%20Details%20Here&location=123%20Main%20St%2C%20Example%2C%20NY">Add to gCal</a>
the parameters being:
Here's a new link structure that seems to support the new google version of google calendar w/o requiring API interaction:
https://calendar.google.com/calendar/r/eventedit?text=My+Custom+Event&dates=20180512T230000Z/20180513T030000Z&details=For+details,+link+here:+https://example.com/tickets-43251101208&location=Garage+Boston+-+20+Linden+Street+-+Allston,+MA+02134
New base url: https://calendar.google.com/calendar/r/eventedit
New parameters:
Notes:
+
for space in addition to %20
(urlencode
vs rawurlencode
in php - both work)UPDATE (free for personal use):
HTTPS IS NOW SUPPORTED
While my answer below detailing how-to for each service WILL work, IMO it's much easier now to go with a third-party like AddThisEvent [https://addthisevent.com]. It lets you customize lots of options as well as add to Facebook and more. Unfortunately, they've now made it a paid service for anything other than personal use and do enforce this.
I assume there are other third-party solutions like this one, but I can only speak to this one, and it has worked great for us so far.
For an "Add to my Google Calendar", they used to have a code generator form you could use, but have since taken it down. For more details on Google Calendar links, see squarecandy's answer below.
For Outlook, it's a BIT more complicated, but basically you need to create a .vcs
file with the event's data, and just make a link to that file. Step-by-step instructions here.
For an iCal link, you could use a PHP class like this one, or follow this page's instructions on how to create an ics
file (iCal file).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With