Blog posts

Stay up to date with Drupal, and discover good Drupal resources

Planet Drupal aggregates drupal related blog posts from a number of drupal sites and bloggers. I've only recently discovered it, but have already found some incredibly useful drupal posts here. For example, this one shows you how to allow "everyone, including “anonymous users”, to be informed of updates to nodes right inside their content", something very similar to what a client has just asked me to do.

Disable tinymce for fields in drupal module: webform

I normally disable tinymce for certain textareas by overriding the tinymce function theme_tinymce_theme. This allows me to target textareas by their name attribute. For example, to disable the editor for all cck fields that I have named 'description', and all the devel modules 'php code' block textareas, one would put the following in that function: function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) { switch ($textarea_name) { // Disable tinymce for these textareas - using the field's name attribute

Make a user agree to a drupal site's terms and conditions

Came across a module that does exactly this, the Legal module. When an anonymous user registers to use a drupal site, they get presented with the normal registration form with the terms and conditions of the site below. If an administrator adds a user, the first time the user logs in, before they can go any further, they need to accept the terms and conditions. In both cases, it's just a checkbox at the bottom of the terms and conditions that they must check before being allowed to continue.

Firefox images getting extra space when in table cell

Disclaimer: OK - so I know I shouldn't be using tables, but sometimes, I just have to. Was trying to figure out this extra space around an image that was sitting in a table cell. Came across this article which explains why. It's to do with using a strict doctype, and the fact that the images are by default inline which display on top of the baseline. Quick fix for me was to apply the following style to the offending images: .header-image {display:block}

Drupal CCK email field errors: "doesn't have a default value query"

Ran into this error a couple of times before when adding content to a CCK email field in MySQL 5.0.27: user warning: Field 'field_email_email' doesn't have a default value query: It seems the email field is initially set up to not allow null values. To fix this check out this patch or just update the field in phpMyAdmin: ALTER TABLE `table_name` CHANGE `field_email_email` `field_email_email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL