Blog Archives

Maintaining Lightbox2 Templating

Lightbox2 is a very popular and powerful Drupal module. One of the helpful features is that you can render a Drupal node in a lightbox rather easily in either PHP or HTML. View detailed explanation. The issue is that when you click

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

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

Using the path_to_theme() function

When we build Drupal sites we typically have a lot of custom design elements. It is important to be able to display images from the filesystem in a dynamic fashion (non-absolute paths). Should you need to move the site, you

Tagged with: , , , ,
Posted in Development

Add Javascript to a Specific Page

There are several ways to add javascript code to a page in Drupal. The method outlined below involves a modification to your theme’s template.php file. You’ll be editing (and un-commenting if necessary) your theme’s preprocess_page function. This basically lets you

Tagged with: , , , ,
Posted in Development

Dynamic and AJAX-driven Select Lists in Webform

This example is a two-for-one deal! I’m going to demonstrate how to dynamically populate a webform select list on page load dynamically populate a webform select list based upon the value chosen in another webform select list For both parts of

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

Altering the basic properties of a Drupal textarea

The following example, when placed in your theme’s template.php file, will shrink the size of all of the “body” textareas on your site to 5 rows, and set the textarea as resizable. The function we’re using to alter the textareas

Tagged with: , , , ,
Posted in Development