Embed Google Calendar plugin


(David García-Navas) #1

Continuing the discussion from Failed to bootstrap with Google Calendar plugin:

Two months ago, I post a topic asking for a developer to do some customizations on Discourse for my organization, Territorio creativo.

Thanks to Vairix, an organization specialized on Rails who have helped us with this, we can now share this customizations.

The first one, it’s simple a plugin that allows to embed a Google Calendar in a post:

Screenshot:


(Kane York) #2

Looking at the code, I think this would be best upstreamed to the onebox code, so that all the sites can use it.

Though… The url matcher might need some tightening.


(Tobias Eigen) #3

so what is the status of this? i would rather not install another plugin but do like the idea of being able to embed google calendars in topics. it would be very useful as a team/editorial calendar on our community.


#4

If @DavidGNavas submits a Pull Request to the onebox repo it could get added, but well, not sure if he wants to do that.

I’d be up to submit it too, but I’d rather let him do that.


(David García-Navas) #5

The developer of this plugin was @Daniel_Fernandez_Pes from Vairix, perhaps he wants to submit the PR, I will notificate him. But, if he doesn’t mind, you are free to do it :smile:


(Daniel Fernández Pescetto) #6

I already send a PR to implemente this feature.

https://github.com/discourse/onebox/pull/255

Thanks for notifying me!!


(Tobias Eigen) #7

nice! but what you’ve done here seems to be about spreadsheets and not calendar? is it possible to also onebox a calendar using a URL like this:

https://www.google.com/calendar/embed?src=editors%40kabissa.org&ctz=America/New_York


(Daniel Fernández Pescetto) #8

You are right!! My mistake! Here is the right PR!!


(Molly) #9

While the embed works on here, any time I try to embed a Calendar on my forum, it doesn’t work.

I’m on the latest version of Discourse and OneBox is included with Discourse automatically now, right? So there’s nothing I really need to add is there?

The plugins I have currently:

Any insight would be greatly appreciated!


(David García-Navas) #10

Sorry for not contribute much to the conversation, but we have the same plugins installed (plus details) on a latest version docker instance and it works perfectly :confused:


(Molly) #11

I’m not sure if it was the Discourse update or that I removed “google.com” from our OneBox list, but they embed now!


(Tom Newsom) #12

Hmm. I’m just trying this out, and I only get an empty calendar. The exact same code in an iframe on wordpress works just fine. Any idea why?

ie:

https://www.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&mode=AGENDA&height=400&wkst=2&bgcolor=%23FFFFFF&src=6hnjp743rq7omi2qfr3fa873ug%40group.calendar.google.com&color=%232F6309&ctz=Europe%2FLondon

(note how the dropdown at top right is empty)

vs.

http://southlondonmakerspace.org/ (3rd from top in the LH column)


(Kane York) #13

Here’s the generated HTML:

<iframe src="https://www.google.com/calendar/embed?showTitle=0&amp;rm=minimal" style="border: 0" width="695" height="521" frameborder="0" scrolling="no"></iframe>

Looks like some of the parameters are getting dropped.


(Tom Newsom) #14

Found that the embed only works if you take the plain URL from the “Embed This Calendar” box in Gcal settings

If you click on “Customize etc.” and paste the long URL with all the parameters separated with &amp; then the important bit (src=6hnjp743blahblahblah) doesn’t make it through.

I am not a coder so I don’t have the first clue about how to a)track down this issue in the source or b)submit a pull request to fix it, but hopefully this helps someone else with the same issue!


(Miguel Ángel López Vicente) #15

Any way to set agenda mode as default?


(Sean Wangnick) #16

Can this be addressed again? We’d like to embed a Google Calendar into a topic, but we’d like to be able to use the customizable code instead of


(Ryan Harris) #17

When you go to generate your embed code, just make all of your custom modifications and then look at the iframe tag that’s generated. take everything in the source attribute.

<iframe src="http://some-crazy-url-with-all-the-styles-that-i-want">

you want to grab everthing between the quotation marks after src=


(xiasummer) #18

Hi, I’ve installed the plugin, and I tried writing the urls google calendar presented me, but nothing happened.

Could you please tell me Why?

@tobiaseigen @Daniel_Fernandez_Pes @Swang007


(EW 👌) #19

Google Calendar & Spreadsheet supposed to work now with Onebox without the need to install an extra plugin. Right?

I’d tried to include Google Calendar but I couldn’t succeed. Could anybody confirm that it’s working and how please?


(xiasummer) #20

What do you mean? Which plugin? How can it works perfectly?

So now, how to achieve the goal of enbeding the google calendar in the Discourse?