Blog Archives

Quick Tip: Adding a Reset button to a Drupal form

Using hook_form_alter or hook_form_FORM_ID_alter one can easily add a “Reset” button to a Drupal form. In this example we’re actually trying to reset anything the user typed after the form loaded. This will not remove the default values. Here’s a simple example (Drupal 6)

Tagged with: , , , ,
Posted in Development

Views Exposed Filter: Terms for current language only

I’ve been working on a multilingual site that has a product finder. We have 3 exposed filters that allow a user to select an Activity, IP Category, or Industry. All of these filters are Taxonomy Term filters. Some of the

Tagged with: , , , , ,
Posted in Development

Proximity by City or Zip Code in Drupal 6 with Location and Views

The location module for Drupal 6 is a robust module. On most projects, it gives us 100 percent of what we need. Proximity searching based on zip code is built-in and fairly painless to setup. I’ve recently been tasked to also allow

Tagged with: , , , , , , ,
Posted in Development

Webform for Campaign Monitor

Webform is an amazing module. Thankfully, you can extend it to make it even more helpful. We’ve had a lot of clients that offer a “Join Our Mailing List” type of functionality on their sites. These forms are typically one or

Tagged with: , , ,
Posted in Development

Disable Specific States in Ubercart

Here’s a quick example that illustrates how to remove a few State/Province options from the billing and shipping panes of the Ubercart checkout form, as well as the order edit/create form. Please understand there are other ways to do this (like altering the united_states_840_1.cif file and

Tagged with: , , ,
Posted in Development

Get the Value of the Cheapest Option for an Ubercart Product

This is just a quick code example. Imaging you have an Ubercart attribute that has several options and you’d like to show an “As low as $X.XX” price on the frontend. Here’s a simple solution. Note that if you wanted

Tagged with: , , ,
Posted in Development

Lightbox2 Slideshows with Multiple-value Imagefields

This is a pretty simple example that illustrates the use of Lightbox2’s slideshow feature. In the example, we have an imagefield that allows an unlimited number of images. We only want to render an imagecache version of the first image

Tagged with: , , , ,
Posted in Development

Get a List of Top-level Taxonomy Terms

Quick Tip: Getting a list of taxonomy terms is easy using a view (type: Taxonomy). Trying to get only terms at the highest level is a bit trickier. One method I came up with is to add a Taxonomy: Parent term argument

Tagged with: , , ,
Posted in Development

Showing a nodeasblock block as full content instead of teaser

By default, the Node As Block module displays a node in teaser mode. If you wish to show the full content, add the following to your template.php file. (note I’ve also added an edit link for good measure)

Tagged with: , , ,
Posted in Development

Sending webform submissions to email based on value of field

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.

Tagged with: , , ,
Posted in Development