Welcome!

Tags: Drupal, Drupal 6, PHP, theming

UPDATE: I've had much better luck with the ​nodeblock​ module. I create an "Editable Block" content type (machine name editblock​) and allow clients to edit these blocks. I've stopped using Node As Block.

By default, the Node As Block module displays a node in teaser mode. After the break, I'll show you how to show the full content of the node using a simple preprocess function in your theme's template.php file.

Tags: Drupal, Drupal 6, hook_mail_alter, PHP

We recently did a site for a client that allowed patients to submit a webform to request an appointment. The user could choose their physician and based on their choice, the submission would be emailed to the chosen doctor's secretary. I originally thought about using the key part of the key|value pair for the select list to store the secretary's email address, with the doctor's name. This wouldn't work, however, because the key could not contain standard email address characters. Read on for the solution...

Tags: Drupal, Drupal 6, hook_form_alter, PHP

A fellow Drupal user posted an issue to the Embedded Media Field project. The user was trying to set the maxlength from 35 characters to some other number for the 'title' field within each embedded video widget. I faced the same issue with a site. The client wanted to be able to add more lengthy captions to each video they uploaded. I added the embedded video field (YouTube) as an "unlimited" video field.

Tags: Drupal, Drupal 6, hook_form_alter, PHP

After the break, I'll show you how to move a field into a different fieldset within a form using hook_form_alter() and a special #after_build form property.

Tags: Drupal, Drupal 6, PHP
$ts = 1288639479;
$local_zone = date_default_timezone_name(TRUE);
$newdate = date_make_date($ts, 'UTC', DATE_UNIX);
date_timezone_set($newdate, timezone_open($local_zone));
print date_format_date($newdate, 'custom', 'm/d/Y H:i');
Tags: Drupal, Drupal 6, mysql, PHP

Have you ever wondered how to properly build a query like this in Drupal:

SELECT nid, type, title FROM node n WHERE n.type IN('page','story');
Learn how to do this after the break.
Tags: Drupal, Drupal 6, PHP

Sometimes projects come up that have requirements that cannot be solved with an out-of-the-box Drupal install. A project I worked on some time ago required that I store a node every time a user registered for an account. The details of the project are a little fuzzy for me now, so I'll just skip right to the example.

Tags: javascript, jQuery

We use menu block a lot to create sidebar menus with specific depths, starting points, etc. The following snippet shows how we can use jQuery to turn a normal <h2> tag into a link. The link's destination will be the same as the first child link.

Tags: javascript, jQuery

The following snippet is one way to determine if a jQuery plugin is loaded an available. There are probably other ways to achieve the same behavior, however this one never seems to fail me.

if (jQuery().jcarousel) {
  // The plugin is here, do something with it.
  $('.jcarousel-enabled').jcarousel();
}
Tags: Drupal, Drupal 6, PHP

The following illustrates one way to render an image using an Imagecache preset.
Naturally, if your imagefield has multiple uploads you could wrap this in a foreach.

Pages