Drupal Planet

A Faster Drupal—a Faster Web

I just sent a new note to the Flocknote Development list about making Flocknote speedier. Flocknote is a very complex web application, and at the beginning of this summer, I noticed that some pages were taking more than a second to generate on our server (that's before the page would be sent to the end user!).

Investigating the performance problems using MySQL's EXPLAIN, the PHP profiler XHProf, and Drupal's Devel module, I found the culprits to be some inefficient and memory-hungry caches and some inefficient database queries. Applying a couple patches that are in development for Drupal, and adding a couple indexes on different tables more than halved average page load time.

I also am actively trying to get these patches accepted into Drupal core and the Views module. Once the patches are incorporated, millions of other Drupal websites and applications will be able to conserve memory and clock cycles as well. You could easily substitute 'Wordpress', 'Joomla', 'DotNetNuke', or any other CMS or platform for 'Drupal' here.

Creative Marketing by Microsoft at DrupalCon Chicago

As seen at DrupalCon Chicago (in the program book):

Web Developers - We are very sorry for Internet Explorer 6 - IE9 Drupalcon Ad

I think the IE development and marketing team at Microsoft 'gets' the situation, and is being very creative about it's efforts in promoting IE9 (case in point: IE6 Countdown). As to how far IE9 will ultimately go towards stemming web developers' collective hatred toward Explorer as a platform... that remains to be seen.

The ad above reads:

Dear Web Developer,

We are so very sorry about IE6.

Come have a drink on us at the Opening Night Party. Also, stop by our booth #67 and we will show you why IE9 is way better.

In my own testing of IE9, I've found it to be about on par with FireFox in how much I'd recommend it to users over any other browsers... that is to say, Chrome/Safari is still better, but I no longer need to tell people they should switch—IE9 is good enough for regular Internet users.

The only thing I really, really hope Microsoft starts doing is taking a more Chrome-like approach to adding in little bits of HTML5 and CSS3 goodness (and fixing some bugs) with point releases, rather than waiting 3-5 years for another IE release! (Of course, IE9 isn't released yet...).

Mass and Sacrament Times on the Archdiocese of St. Louis' Website

One question I'm often asked by many other diocesan web development teams/individuals is how we put together our online Mass Time search (also used for searching adoration and reconciliation times). We also get questions about how we do our online mapping—but I've already covered that (see: Beautiful, Easy Maps in Drupal using Views and Mapstraction).

Mass Times Search Interface
The Archdiocesan Mass Times search interface (click to enlarge)

We already have a database provided by the Archdiocesan IT department (they maintain it with the help of our diocesan Parish Support staff, and parish secretaries who can update their own schedules and information), so we needed to do the following on the web:

  • Import all the Sacrament time information and attach it to a parish node (so times/days could be affiliated with parishes).
  • Display the time information on parish node pages, in a meaningful way.
  • Allow users to search by Sacrament times, showing parishes on a map, and showing the Sacrament times in a list under the map.

I'll cover each of these important aspects of our website's functionality below.

Preliminary note: much of this code was provided originally by the great folks at Palantir, who helped us set up this and many other features on the Archdiocesan website...

Importing time information, attaching it to Parish nodes

The first step in the process is importing some 3,000+ parish event nodes (which contain data for each 'event' - the event time, the event type (Mass/Reconciliation/Adoration), whether the event is a 'Normal Service' or a special kind of Mass, the location of the event (often in a side chapel or somewhere else), the event day, and the reference for the parish to which the event is attached.

Our site uses the Migrate module to import all the data, and we have the module set up to import all the events first, then import the Parishes, attaching the events to parishes (through custom code) using a node reference.

Beautiful, Easy Maps in Drupal using Views and Mapstraction

I've been asked about the Archdiocese of St. Louis's online parish search mapping functionality enough times that I finally made a quick video walkthrough of how it was done. The video below explains it all—basically, we use the Location module to attach addresses to nodes and geocode (get lat/lon) the addresses, and we use Views + Mapstraction to make the spiffy maps all over the site.

The functionality was originally set up by the kind folks at Palantir, and tweaked a bit over time by me to make what you see today.

You can watch the video in HD on Vimeo, to see fine details. (Recorded with iShowU HD).

Drupal 7 Released - Have You Tried Drupal Lately?

Get Started with Drupal 7

Today, January 5, Drupal version 7.0 was released (download Drupal here). Drupal 7 release parties will be held worldwide on January 7 (which also happens to be my birthday - yay!).

I'll be posting my experiences in upgrading to and extending Drupal 7 both here and on my blog at Midwestern Mac, LLC (see D7 stories).

Congratulations to the team of almost 1,000 developers who helped make Drupal 7 a reality, and congratulations to Dries Buytaert, the founder of Drupal, and webchick, the person who shepherded (and continues herding) the community as the Drupal 7 core maintainer!

New minimalist theme released for Drupal 7 - MM

About a year-and-a-half after releasing my first contributed theme for Drupal, Airy Blue, I have finished and release my second contributed theme, MM - A Minimalist Theme.

Minimalist Theme Screenshot

MM is my first HTML5 theme, and my first for Drupal 7 (which, by the way, is awesome!). I have been working on refreshing my LLC website, Midwestern Mac, for the past few months since I scrapped my first hacked-together theme from about 2.5 years ago, and I finally decided to take the plunge and go Drupal 7 for the redesign.

MM is based on Boron, an HTML5 base theme that is still in beta for Drupal 7 (thus, I can't have a final release of my subtheme until Boron is final as well).

The theme has a few nice features:

Online Calendaring: FullCalendar.js

In my always-continuing quest to find the perfect online calendar display/management solution, I have found the next level of calendar display/management bliss.

Previously, I was pinning all my hopes on Drupal's very robust, but often complex and confusing, Calendar.module (in use by almost 50,000 websites—and for good reason—it's extremely adaptable). The module provides many different displays, and gives you the ability to link directly to a specific day/month/week... but it (a) is relatively slow to allow switching from month to month, (b) requires a rather complex view, with arguments, which can be confusing for first-time users, and (c) it takes patience to theme it well.

I love the Calendar module, and I still use it on a few sites where necessary, but I've found a new contender that has nothing to do but improve; that condender is the FullCalendar module, which is based on the great fullcalendar.js jQuery-based calendar library by Adam Shaw.

Fullcalendar Display
This is IE. It's easy enough, though, to add better styling to a fullcalendar.

Embedding a 'Related Content' block in your Drupal nodes

Many of my favorite websites offer a nice little feature, immediately following the body of the page, that highlights 3-5 "possibly related" stories or blog posts. I wanted to do this on OSC and some other sites, but found that it's difficult to add regions inside of nodes—the closest I could get with the default theme/block behavior is to have it appear after comment section, which is too far down the page to be relevant.

I decided to use the Featured Content module to create my blocks, as it offers a good amount of customization as to what kind of algorithms it uses to find related nodes... performance considerations aside. There are other ways to go about creating lists of related nodes, but this was quick and easy.

Adapting a solution I found here, I created a simple function inside my template.php file that allowed me to print a block from inside my node.tpl.php template.

Inside template.php:

Create a Podcast, Quick n' Easy, using Drupal with Views + FileField

Podcast LogoAfter having created a few different podcasts on different Drupal sites for different purposes, using a variety of methods, I can speak with a little authority on which methods are the best, easiest, etc. There is an Audio module, and an iTunes module, which help with more advanced podcasting needs... but most people just want a podcast which will allow visitors to either listen while on the website, or to be able to subscribe to the podcast in iTunes or another media player.

If your needs are relatively simple, it's quite easy to get a podcast up and running on your Drupal website:

How to Build a Drupal Module - for Beginners

DrupliconAt a recent St. Louis area Drupal meetup (details here), I presented a quick session on how to build a drupal module, geared towards beginning Drupal developers (I don't consider myself too advanced, but I have found that my experiences can often help others).

I have attached to this post the custom module (a .zip) file that I included for examples in the presentation, and I also uploaded the slideshow (quick and easy - just 12 slides!) to slideshare. I've embedded the slideshow below:


Subscribe to RSS - Drupal Planet