Drupal

Please note...the following articles relate to the Drupal content management system and are generally only of interest to other developers and web site builders. We don't tend to allow comments on these articles, but if you do require further explanantion please use the contact page

Create tokens for profile fields Drupal 6

by John McGeechan

Synopsis


 How to add profile fields to the token logic

 

 

Overview

Two hooks are required..

  • hook_token_list to add fields to the list of available tokens
  • hook_token_values to provide the values for those fields

 

Here's some code I prepared earlier....

 

Drupal cache_get - why it doesn't always give you what you expect

by John McGeechan

Drupal cache_get - a gotcha


Background

Noticed that cache_get did not seem to obey the cache lifetime, returning 'expired' cache data

Overview

After over-abusing the drupal cache tables, to store any and every bit of custom cached data, using the default 'cache' table, I decided to roll my own

Views AJAX problems

by John McGeechan

Overview

Recently had the ajax functionality in views admin suddenly start  throwing errors...

An error occured at /admin/build/views/ajax/config_item/....


This error extended to most ajax operations with views admin and meant that none of the ajax functionality would work

Drupal and mollom

by John McGeechan

Drupal and mollom - or why users may not be able to register on your site and you would never know it


Background

We currently run drupal on a single code base over multiple domains (via domain module suite). Just recently we had reports that some users could not register on some of the domains as they could not answer the Mollom captcha correctly

Using drupal and SVN for module updates - best practice ?

by John McGeechan

Synopsis


 One way to release module updates using drupal and subversion

Canonical meta tags for drupal multiple domain sites

by John McGeechan

Synopsis

 Slight enhancement to domain_source module to add canonical meta tags to node. Canonical meta tags can improve SEO

Easily Define preprocess functions by content type in Drupal

by John McGeechan

Synopsis


A shorthand way to provide preprocess "hooks" for any content type.



This snippet can be placed in a template or your chosen module, I usually place this in both the node and page preprocess function eg

Drupal plugin written in Jquery to increase or decrease web elements or font sizes

by John McGeechan

Synopsis

 A handy little Drupal plugin that let's users increase/decrease fonts with a single click

nb I tried  the official drupalfont  resizer, but could not get it working, on the off-chance that you have the same problem...

Overriding module functionality in Drupal

by John McGeechan

Synopsis

Sometimes it is necessary to override the functionality of a particular module. You may wish to to customize some functionality but without hacking the core code of the module.

How do you do this ?

There are several ways, here is just one.....

Drupal navigation on error pages

by John McGeechan

Synopsis

As of drupal 5.x blocks are not processed on 403 and 404 error pages, instead the contents of the specified pages are used along with the site theme to create an error page (or simply the words 'page not found' if no error page has been specified).

This decision was a deliberate one....