Like Duvall’s Kilgore, who said “there’s nothing like napalm in the morning”, for a web geek, there’s nothing like a bit of curious fiddling with code to make something work. Today’s feat was finagling a MediaWiki extension to display a Google Calendar in our sites.
I’ve been using GCal for a year to manage our Second Life events, and Google provides the cut and past code to put in other sides, like our WordPress blog – but MediaWiki is not going to be happy with some <iframe> code, so on some searching I found reference to one on the CouchSurfing Wiki – yet was discouraged that their demo was busted:
Going back to the Google search well, I came on the listing of same code in the MediaWiki collection
and it suggested that the calendar ID entered in the tags had changed. So there was hope.
Setting up MediaWiki extensions is not nuclear physics, but it is a far cry from “plug-in” or “widgets”. You have to copy some PHP code, upload it to the server, hand edit the MW settings file (and hope you did not chop a semi colon- a blank page is a sure sign of a typo in an extension).
The next tricky part was getting the right ID for our calendar. It looks like an email address, but at first it seemed like it had to be the primary calendar on an account, and the one I set up was actually a secondary calendar. It is there in the Calendar settings, under details- the text where it declares the calender ID:
Ahhh, but there is more subtlety- in the tags you (hand code) in MediaWii, you have to swap the “@” for its url encoded entity, “%40”, so adding it to my mediawiki page is as intuitive as:
But wait there is more– the default layout was rather.. pinched, so to make it wider, I had to go into the extension source code, and bump up the height and width for the iframe tags.
But in the end, and now that I know, it is easy… well, sort of. I have an embedded calendar now for two different SL events, one is ours from NMC, and the other is one maintained by Bruce Summerville in Sydney, who hand adds them to a public calendar when people advertise them on the SL Educators listserv.
Smell the napalm!
The post "What’s That Google Calender Doing in My MediaWiki?" was originally scraped from the bottom of the pickel barrel at CogDogBlog (http://cogdogblog.com/2007/08/google-cal-mediawiki/) on August 30, 2007.