Skip to: Site menu | Main content

michael's blog

Two Simple Modules: Favicon and Incoming

One thing I do while developing Drupal sites is make frequest trips to the "Recent Log Entries" page (admin/reports/dblog) to see what kind of trouble any custom code (or rouge themes and modules) I've added is causing. It is a quick "sanity check" to make sure things are moving in the right direction.

A pet peeve of mine when using a custom theme has always been the "page not found" log entry for the "favicon.ico" file. When using a custom theme (or an overridden favicon.ico file), while Drupal outputs the correct path for the link tag that specifies the file, some browsers still look for the favicon.ico file on the root of the web site. Normally, I "fix" this issue by making a duplicate of the favicon.ico file and placing it on the root of the site.

Submitted by michael on Fri, 09/05/2008 - 10:31am
Filed under:

Trying out Lightbox2 with Imagecache and Imagefield in Drupal 6

I have a new client that has hired me to build a small, Drupal-powered web site for his scholarship foundation. Since the site is very straight-forward and not slated to go live for a few weeks, I decided to see if I could build the site using Drupal 6. The big challenge is seeing if I can get all of the image functionality working (and stable) using the bevy of development- and alpha-versions of the necessary modules.

The idea is to be able to add an image field to the standard story and page content types and use ImageCache and Lightbox2 to display the images. As of this writing, the required modules are at various stages of development:

  • CCK: 6.x-2.0-rc6
  • Lightbox2: 6.x-1.8, but only the development version is working with CCK2 at this time.
  • ImageCache: 6.x-1.0-alpha2
  • ImageField: 6.x-3.0-alpha2
  • ImageAPI: 6.x-1.0-alpha2
  • FileField: 6.x-3.0-alpha4
Submitted by michael on Thu, 09/04/2008 - 10:31am
Filed under:

Custom GMap Solution for Automatically Centering on User Location (Part 3)

In my previous two posts, I discussed how I implemented dynamic markers and the PdMarker custom marker type into the home page for The final major GMap customization I added was the ability of the map to automatically center and zoom on the user's location based on their IP address. The solution isn't always perfect (depending on the user's internet access provider), but more often than not, it gets pretty close.

The tricky part of implementing this feature was being able provide it for anonymous users while Drupal caching mechanism was activated. Later in this post, I'll show you how I did it using a combination of hook_init(), cookies, and Javascript.

Submitted by michael on Sun, 08/31/2008 - 10:33am
Filed under:

Custom GMap Solution for Dynamically Updated Markers (Part 2)

In my previous post, I talked about how I implemented the dynamic marker system on In this post, I'll cover the functionality that the PdMarker adds to the site.

When you first hit the home page of the site, you'll see that the main content area is separated into two main sections: the narrow column to the left of the map (I call this the "info column") and the map itself.

Submitted by michael on Wed, 08/27/2008 - 10:54am
Filed under:

Custom GMap Solution for Dynamically Updated Markers (Part 1)

I recently upgraded with a custom map interface based on the GMap module. I was able to do this while leaving the GMap module is virtually un-hacked (with the exception of modifying the "GMAP_API_VERSION" variable) - all of the customizations were made via an additional "helper" module that was written specifically for this site.

The site utilizes a map on the home page that shows all the off-roading areas and clubs in the database. The problem I was trying to solve was that I didn't want to have to load all 1,500+ points each time the home page was hit. Not only was this a waste of resources, but it also slowed things down considerably for the user.

Submitted by michael on Mon, 08/25/2008 - 10:08am
Filed under: