Drupal Blog

Drupal 6: Programmatically Remove Required Field Property from Form
Last edited on: 19/11/2011 - 13:06

Suppose you are coding a form in Drupal 6 and you have a mandatory (required) field. However, this required field is only mandatory dependent upon the value in another field. This can happen quite often, and I encountered it at a client site the other day. We had a postcode field that was mandatory only if the country in a selection box was set to 'United Kingdom'. Any other country meant that the postcode field was not required.

»   Read more
Drupal 6: Programmatically Create Panels and Nodes in Panels
Last edited on: 28/07/2011 - 14:26

This tutorial provides the wherewithal to create a new node and insert that node in the top pane on a programmatically created Panel. Looking around the net I was surprised that nobody has done this before. The context for my requirements comes from a not-for-profit client of mine - they wanted to be able to create a new type of charitable donation dependent upon a campaign's remit (this would be the node) and then to place that campaign information (node) in the top pane of the panel.

»   Read more
Drupal 6 Checkboxes and default_value
Last edited on: 29/04/2011 - 09:57

The Drupal Forms API comes with some powerful features, including checkboxes which allows a bunch of checkbox options to be grouped together. Included in this functionality is the ability to set default values, i.e. set your chosen boxes to be on.

However, it is not immediately obvious how to programmatically set the default values using the '#default_value' key. The key expects an array, so I tried the usual contenders such as an array of 0s, 1s, 'on', FALSE, TRUE etc etc and just couldn't get it to work correctly.

»   Read more
Drupal 6 White Screen of Death on Top Level Landing Page
Last edited on: 06/02/2011 - 14:04

I have a number of Drupal sites on the Internet; more than I can possibly check on a daily basis, what with work commitments and all. I pointed my web browser at one of the more infrequently visited sites the other day and was confronted with the White Screen of Death. Disaster! What on Earth can cause that? And how long had the site been down? A quick check of the log gave no evidence of anything amiss, and the integrity of the database looked ok with a cursory glance.

»   Read more
Drupal 6 SMS Framework: Esendex PHP5 SOAP Gateway
Last edited on: 10/05/2010 - 14:50

Drupal 6 SMS Framework enables the sending of SMS from a Drupal 6 website, through a suitable bureau service. The 'glue' between the SMS Framework module and the chosen SMS bureau is called a 'gateway'. Each bureau needs the development of a dedicated gateway, and currently there are few available. In reality, the only gateways for Drupal 6 are Clickatell and a generic email facility.

»   Read more
Drupal 6 dCaldav Caldav/Webdav Client Module
Last edited on: 23/04/2010 - 19:56

CaldavdCaldavThe sporting fixtures listed on this website under the "Sporting Fixtures" menu item are created automatically using my own Drupal 6 dCaldav module.

»   Read more
Drupal 6 Bulk Save of Taxonomy Terms with Perl
Last edited on: 23/04/2010 - 10:59

You may be faced with the prospect of performing a batch save of taxonomy terms on your Drupal 6 installation. Using the normal interface, despite being clean and efficient, it could be an onerous task of many mouse clicks and wandering concentration resulting in errors. I was faced with such a situation so decided to quickly develop my own utility to perform a bulk save on my behalf. I decided upon Perl as the language to code in because I did not want the development time associated with user interfaces - this utility is for command line aficionados.

»   Read more
Drupal 6 Programmatically Create image_gallery Images in PHP
Last edited on: 23/04/2010 - 10:57

Or since image_gallery items are just images with a taxonomy tag in a vocabulary called Image Galleries, a subtitle could be Programmatically Create Images and Tag with image_gallery. In this tutorial we are going to create a small module which contains the code to create the images and has a button on a form to effect the creation. I will foreground the actual copying code so you can cut and paste it into your own module development.

»   Read more
Installing Drupal GeSHi Filter Module
Last edited on: 23/04/2010 - 10:56

The installation of the Drupal 6 Generic Syntax Highlighter (GeSHi) module is of course trivial and wouldn't be worth further consideration if it wasn't for its dependency on the GeSHi PHP Library. Every time I come to install a new PHP library on my rig I am always faced with remembering (a) where the PHP configuration file is so it can be edited with a new path, and (b) where to stick the new library on my filesystem.

»   Read more
XML SiteMap Print - A Simple Drupal Module for Beginners
Last edited on: 23/04/2010 - 10:55

One of the problems with Drupal is there are three different Drupal modules that generate sitemaps for your website. So why is that a problem? Well, none of them appear to me to be perfect. Maybe I am using them incorrectly - if so, *PLEASE* let me know so I can correct my comments! The three modules are:

Lets have a look at them in turn.

Site Map

»   Read more
Syndicate content