Skip navigation

Drupal 5.x

Quick and Dirty Drupal Content Updates

It's fairly common to have a development site and a live site running at the same time - whether it's a Drupal 5 to Drupal 6 migration, or simply a development environment for test features before running them on the live site. In any case, one of the issues that comes up here is that the content on the development site can quickly become out of date.

Introducing the Connect Module

OK, so the Connect module has actually been around for a while now, but the first version was painfully difficult to use, and the second version has only just seen an official, albeit beta, release.

Connect arose because we wanted to create a flexible and extensible online campaign platform for Drupal. The goal was to produce a framework that would allow different features to be added as necessary. Thus, a single tool could be used to create a simple petition or a sophisticated online email- or fax-sending campaign.

Earth Hour Drupal Module - Learning to Turn Off

Tell all your visitors you support the efforts of Earth Hour. It's a simple measure for the environment.

With the Earth Hour module for Drupal you can easily show your support and have your site automatically "shut off" for the hour, no matter where in the world you are.

The plugin counts down to earth hour, counts how many other sites are using this plugin, and share the link to earthhour.org with your visitors.

switch logo based on url

In page.tpl.php place the following code: This example uses strpos() which is less resource intensive but may run into problems on pages where the url contains both sub strings, eg. example.com/marketplace/blog/ may behave like a blog instead of a marketplace. N.B.

Using SimpleTest in Drupal 5

I have been writing a unit test for the connect module using the simpleTest module. The following is a discussion of my experiences. This article from Lullabot is what I mainly used as a reference. Note that if you are following this article be sure to read the comments at the bottom. Especially that hook_simpletest is not required.

Installing SimpleTest

In Drupal 5 simpleTest uses a PHP library for its testing. In later versions of Drupal this library is not used. Once you have finished downloading the simpleTest module read the INSTALL.txt file. The only extra step to configuring this module is to download the simpleTest PHP library and placing it in the ...all/modules/simpletest/simpletest directory.

Theming forms with template.php by overriding theme functions

Here we are confronted with a situation where the default markup of a form on your site needs to have a different look. For instance when we need the form to be located in a block(eg. in a sidebar) rather than in the main content region of a page. Theming overrides are necessary here to make the form input fields shorter in order to fit within the sidebar region. This is accomplished by editing the template.php file and then creating a corresponding xxx.tpl.php file for the theme.

Theme override screenshot

Creating a drupal photo gallery site with cck and views

In this blog entry I outline the process I used to develop a fully functioning web gallery for my photography with drupal5. varunbaker3.png With good old google search by my side, being the great wealth of knowledge that it is, this turned out to be a simple process of just following a few tutorials.

Find a suitable theme

First off I wanted to find a suitable theme, something simple yet stylish. I was looking for a dark grey or black minimalist background so as not to distract from the impact of the images. I settled on this theme

Script for moving nodes from category to taxonomy

Recently the Category module has been causing OpenConcept significant difficulty - see Ron's post here.

We are transitioning this site from using the Category module to using the core Taxonomy module to categorize our content. We're using Views to build pages of content, something that was done by the Category module previously.

The first step in this transition is making sure that node-category relationships are mirrored by node-term relationships. This is a pretty straightforward database manipulation. Here's a script for doing that operation.

Creating a flash cck content type with swfobject.js

OK so you want users to be able to author their own pages using flash(*.swf) files. The technique outlined below will allow users to embed a flash file into pages they create using javascipt(swfobject.js).

Upgrade to Ubercart and removal of Categories module

Ubercart - One Cart to Rule Them AllWe decided to upgrade our websites from the ecommerce module to the new Ubercart 1.0 shopping cart.

Ubercart (http://www.ubercart.org) simplified the order taking process and has a very customizable checkout, shipping and tax settings.  We were even able to charge GST tax on shipping!  The one page checkout is great and calculated the shipping on the fly as you enter your shipping address.  It will even automatically create an account for you so you can view your order status or print an invoice (or download a file).