Hello,
Apologies for the delayed reply.
You can construct an “Add to my calendar” link for Google Calendar, by using something like this in the event display builder field:
<a href="http://www.google.com/calendar/event?action=TEMPLATE&text=[event-title]&dates=[start-custom format='Ymd\\THi00\\Z']/[end-custom format='Ymd\\THi00\\Z']&details=[description]&location=[location]&trp=false&sprop=&sprop=name:" target="_blank" rel="nofollow">Add to my calendar</a>
(This is based on the code that the page you linked generates)
There isn’t any workaround to get the iCal equivalent working, as far as I’m aware.
Hi Ross,
Thanks so much for your help on this! So far it works really well except for a couple of things.
1. The google page that generates the URL seems to convert all the times to GMT or equivalent. Therefore a meeting at 12pm in Los Angeles comes up as “190000” or something like that in the URL. Since most of our meetings happen in one time zone (PST), I’ve just added the offset parameter of[start-custom] and [end-custom] to 25200 (7 hours in seconds) and that seems to work alright. However, if there is a smarter way to take into account time zones and such, I’d appreciate any advice you might have.
2. In most of my descriptions on google calendar, I have some html markup (,,
). I find it helpful to both display the event nicely in the GCE widget and to add links and such. But the html seems breaks the URL when I include [description] in the URL (whether or not the html parameter is set as true or false). The URL works if I leave out the description, but do you know of a way around this? It would be great to include it if possible.
Thanks again for your help!
-Kim
Kim,
It doesn’t seem to be possible to specify a timezone in the date / time string in the URL (or at least I can’t figure it out), so I don’t there’s any better way of doing this, I’m afraid.
I see what you mean about the HTML. Fixing this would probably require changing the plugin code a little, to either strip the HTML, or URL encode it.
Hi Ross,
Thanks for your help! Any suggestions about where I might to strip the html or url encode the event description getting pulled from a google calendar? I’m not particularly conversant in php, sadly, but if you could point me in the direction of which file I should be looking to change, that would help quite a bit :-).
It is also a bit of a challenge b/c I want the html formatting to show up in the description in the tooltip or event list, but not to mess up the “add to calendar” url. Is there a relatively straightforward way of doing this?
Thanks,
Kim