WordPress.org

Ready to get started?Download WordPress

Forums

Google Calendar Events
Direct link to add specific google calendar event? (5 posts)

  1. klderose
    Member
    Posted 9 months ago #

    Thanks for a great plugin!

    Right now, I have the [link] parameter in my GCE tooltips which goes to a simple page with the event description, but I realize it would be better to have a link that allows a user to directly save the event to their google calendar. Is there an appropriate URL structure that will work for this that I could add to the event display builder? Perhaps something that uses the [event-id] parameter? Sorry if there is an obvious answer - all I could find was this resource from google which is pretty useless for automating anything as far as I can tell.

    P.S. I noticed in a previous post that recent changes in google calendar have prevented a similar solution for directly adding iCal events. Have you by chance found a workaround for this? I'd ideally love to have two links in my tooltip ("Add to Google Calendar" and "Add to iCal").

    Thanks for your help!!!!

    http://wordpress.org/plugins/google-calendar-events/

  2. Ross Hanney
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  3. klderose
    Member
    Posted 9 months ago #

    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

  4. Ross Hanney
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  5. klderose
    Member
    Posted 9 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic