Display Google Calendar XML Feed In A Drupal Block

Display Google Calendar XML Feed In A Drupal Block

screenshot of gcal events module I just installed the Drupal module GCal Events, which pulls in a specified Google Calendar, and it's working pretty well besides a few "gotchas." First things first, read the documentation on this one. It's very important to know the extra steps needed to get this working and displaying in a format that works. The most important thing to note in the documentation is that you will need to download and upload "SimplePie" in order for the module to parse the XML feed it obtains from Google. Once the module and Simple Pie are installed, you might experience a fatal error message for memory. Version 6.x-1.4 of the module loads 2500 calendar entries, so this may cause some problems. If you experience this error, try installing the development version of the module, which limits the number to 50. I installed the dev version and the fatal memory error was resolved. Next necessary step is to configure the GCal Events module by going to "Site configuration > GCal Events module settings." You will want to be sure to create the "cache" folder in the directory listed (or define your own directory), and set the permissions for the owner to write to the folder (700). You can also specify the date formats you would like to use by referencing the php date formats to customize what you want. Don't be scared away by the word "php." It's really simple to change the date formats in Drupal. Visiting the date format section of the php manual, you will see the characters that represent what is output. On my site, I set up the formats to be Date Format: "M j, Y". M="A short textual representation of a month (Jan or Feb)"; j="Day of the month without leading zeros (1 or 31)"; and Y=A full numeric representation of a year, 4 digits (2009). So now my dates will display as "Jan 1, 2009" for example. Going down the settings page now, for Input Format, stick with Filtered HTML. Save the module settings, then we are on to configure the GCal Events block. Configuring the block is pretty straight forward and the module's documentation will tell you where to find Calendar ID and/or Private ID in your Google Calendar settings. The fun part in configuring the block comes down to what you insert in the template fields. Play around with different html tags. If you did indeed select "Filtered HTML" as the input format, be sure that the html tags you are trying are also allowed for that input type. You can configure allowed input format tags by going to "Site configuration > Input Formats" and clicking on "configure". And those are the basics of getting this module installed and configured. There are several public calendars that can be used, if you do not wish to pull in your own. For my site, I pulled in Google's public calendar for "US Holidays", but there are several others out there if you do a little research. Have fun!

Related Posts

How to display an RSS feed in a Drupal block

Kristin Brinner
Read more

How to Create an Editorial Blogging Calendar Using Google Calendar

Felipa Villegas
Read more

Embed Google Calendar on Your Webpage

Jennifer
Read more

Managing Drupal 7 display modes video

Tom McCracken
Read more

How to Programmatically Create a Quicktab Block in Drupal

Dustin Currie
Read more

Creating Custom Fields In Drupal Using Display Suite

Kyle Taylor
Read more