Programming Paddling XOOPS Computing Internet Linux Drupal Networking Media Home Theater |
Embedding Google Calendars
Notes on embedding public (or private) Google calendars into a webpage. Specific to XOOPS to a degree, but generally good for any website. I needed to embed Google calendars into a set of webpages. It's easy and Google has instructions on embedding one (or more) Google calendars into your website. I was embedding them into the Publisher module of XOOPS (using their pagewrap feature, but you can use other modules, too, including the PageWrap module). Quick InstructionsEssentially, it's pretty easy, you just need to add an iframe with their code which is a link to their calendar and passing the correct HTTP GET variables in the request URL. It's easy to get the code for this for a single calendar. Just go to the calendar, on the left column under My calendars, choose that calendar's drop down and select Share this Calendar. If you want it to be publicly available, you'll have to check Make the calendar public (on the Share this Calendar tab) and save it. To get the embed code, click on the Calendar Details tab (link) near the top. You may change the way it displays using the Customize the color, size, and other options link (aka, Google Embeddable Calendar Helper - notes on the various options below). ExamplesNote neither example actually works because the src variables are faked. SimpleMinimal required definition, this one based on the primary calendar for a gmail email address, assuming it's first.last@gmail.com.
You could likely leave out the ctz, but I don't know which timezone you'd get. Notice standard non-SSL URL. Multiple CalendarsThis example uses no defaults and all options including multiple calendars each with different colors of display.
ParametersUse either insecure HTTP or secure HTTPS (as shown in the examples) – your choice. You need to use %40 for the at (@) symbol in the link. You can glean the src from the URL for each Google calendar, and to combine them, you just need to add additional src= to the URL (see the multiple calendars example above) and if you want them to display in different colors, then just use a different color=statement after each src=. Primary URL: https://www.google.com/calendar/embed? Other variables (var=value – & separating), none required except the calendar source.
There could be others I don't know. Also, there are a couple that affect the iframe itself - width, height, and border, all of which can be set by CSS, so use as you see fit.
BTW, Private calendars are displayed the same way, but you have to be logged into Google to be able to see/access them. Good luck.
|
Login
Search
|