Development

Blogs about code development.

Colorbox replaces Thickbox module for Drupal

 Plum blossom in Trosa Sweden

The Colorbox module has now replaced Thickbox module for lightbox effects here on xdeb.org. Here follow some background around the projects.

In the Drupal 4.7 days I was looking for a jQuery based Lightbox solution and found the ThickBox plugin. I developed the Thickbox module to integrate it with Drupal. Today it’s used on more than 19000 web sites.

Since a couple of years the Thickbox plugin is no longer maintained and it’s becoming cumbersome to keep it updated with good browser support. Time for a new solution.

Spice up your Drupal 6 site search field with a bit of jQuery and CSS

The search field is an important part of almost any web site today and it deserve some attention. Especially if you have implemented some really good search like Apache Solr (see How to set up Apache Solr search for Drupal 6 on a Debian GNU/Linux server).

This is an update to an older post on the same subject but for Drupal 5. This new version is for Drupal 6 and adds jQuery 1.3+ compatibility plus some nice CSS for Firefox.

If you use Safari, or any other Webkit browser, the spiced up search field looks like a standard Mac OS X search field:

Safari search field example

With the help of some CSS I made the spiced up Firefox search field look somewhat similar:

Firefox search field example

All this is done with JavaScript and CSS on the original Drupal search form ensuring graceful degradation. If you turn of JavaScript all that happens is that you get the standard search field and button.

Here follows the code I use to implement this here on xdeb.org.

Bash script to make development settings on local Drupal database

A common thing you do in Drupal web site development is to take a database dump from production/staging/testing and use it to update your local development environment.

In your local development environment you want other settings for things like error reporting and cache, enable/disable modules etc.

I recently upgrade my script for this to make use of Drush 3 and thought I would share it.

Building complex web sites the Drupal way - Session at BarCamp Kerala 7

BarCamp Kerala

At BarCamp Kerala 7 in Kottayam I gave a Drupal session about how to build complex web sites the Drupal way.

Below you find the slides as a PDF file and the blog system “feature” I demonstrated.

It was real pleasure to be a part of this BarCamp Kerala! There are some seriously smart people here, many interesting start ups and most of all, really nice and friendly fellow geeks.

Earlier BarCamps included some Drupal sessions so many knew about it already and a handful of the participants use Drupal for there own web sites.

After a short background on Drupal I described the Drupal way, less coding and more configuration. I mentioned some example web sites and talked about the advantages of building web sites this way.

Converting your Drupal MySQL databas from MyISAM to InnoDB

In Drupal 7 InnoDB will replace MyISAM as the default storage engine for increased scalability and data integrity. Most big sites are already using InnoDB, drupal.org does since some time.

InnoDB is generally a better choice for Drupal so why wait for Drupal 7. Lets go ahead and convert our Drupal 6 tables to InnoDB.

Results of running Lighttpd as a static file server for Drupal 6

Google webmaster tools - Time spent downloading a page (in milliseconds)

In my blog post Running Lighttpd as a static file server for Drupal 6 on a Debian GNU/Linux server I describe how I set up a static file server here on xdeb.org. I mentioned there that I have not done any benchmarking on the improvements. I still haven’t, but I found some interesting information on Google webmaster tools.

I use Google webmaster tools to submit my sitemaps. One or two times a year I go there to see if everything is in order. They have done some updates since I was there last and this time I found “Crawl stats” under “Diagnostics” (they may very well have been there for a long time but i found them now).

The image show the chart for “Time spent downloading a page (in milliseconds)”. Notice the big drop in late July. That’s when I implemented Lighttpd as static file server.

The average time Google spent on downloading a page went from well over 1000 ms to around 600 ms. I’m very pleased with that result.

Bazaar workflow for developing Drupal based web sites

Bazaar version control system

During the summer I have worked out a Bazaar based workflow for Drupal sites that I think will work well for me. I have moved most of my sites in to this workflow and worked on them for some weeks and it feels good.

I will also mention Drush, the Drupal shell, in this blog. I use it to update modules and database as well as dump and load sql files. If you are not yet using Drush it time to start now. It’s very nice indeed!

This workflow is for when you have a number of small/medium sites that you need to maintain on a continues basis. Big sites with many developers have different needs.

I will assumes that you are familiar with version control systems and at home on the command line.

Running Lighttpd as a static file server for Drupal 6 on a Debian GNU/Linux server

Lighttpd web serverI found Robert Douglass article Using Lighttpd as a static file server for Drupal and thought it would be interesting to try out. Check also out the Lighttpd home page (pron. lighty).

There are two main reasons for using a separate server for static files. The first is to offload the main server, e.g. Apache with mod_php, letting it only handle the dynamic requests. The second is to allow browsers to download files in parallel and without the overhead of cookies etc.

After I implemented the static file server Yslow gives xdeb.org Grade A with a score of 94.

How to set up Apache Solr search for Drupal 6 on a Debian GNU/Linux server

Apache Solr SearchAt DrupalCamp Stockholm 2009 Robert Douglass from Acquia talked about Drupal with Apache Solr search. Solr takes searching in Drupal a huge step forward. Speed and faceted search on author/type/term/language/date/CCK fields are the main features. A “Did you mean …” function is there also and it works surprisingly well.

There are also some really interesting things coming like multi site searching, dokument searching and searching of external non Drupal sites.

Drupal.org is already using Apache Solr search. Search for Sweden there and I’m the top result! http://drupal.org/search/apachesolr_search/sweden

When you search on Drupal.org or here on xdeb.org check out the blocks at the side of the search result page. They let you sort the result and filter it by author, node type and taxonomy terms. This is faceted search.

For people who don’t want to set up and maintain there own Apache Solr search Acquia has the service Acquia Search with a 30 day trial.

If you still here and want to know how to set up Apache Solr for Drupal 6 on a Debian GNU/Linux server here follows how I did it.

Make a Drupal theme look better on the iPhone

xdeb.org on the iPhoneI’m using Safari on my iPhone to browse the web more than I thought I would. Mobil Safari display pages very much like Safari on Mac OS X so it mostly works really well. A web design however rarely works well on both a big computer screen and a small handheld screen, even a high resolution one like on the iPhone.

I was not satisfied with the way xdeb.org looked on the iPhone. I wanted a simple way to improve it without the need for a separate theme or other more complicated solutions.

Syndicate content