Recent Drupal articles

Wrap first letter and first sentence in span via jQuery

For each target element, this script will wrap the first letter and the first sentence of the text. This is particularly useful if you need to style Drop Caps or a leading sentence.

Managing account registration for multiple user types

The Scenario

You're building a new Drupal site that needs to handle two distinct types of users: Consumers and Service Providers. Each user group must have a unique role, profile type, and registration page. Users of each type should be able to visit your site, find the correct registration page, fill out their profile, and be granted an account with the correct role. Sounds easy, right?

Using your email address as your Drupal username

It can be difficult to remember all of the usernames and passwords that you use to log in to various websites across the internet, so why force users to create a new username for your web site? It's easier on everyone to simply combine the username and email address fields. It also cleans up your registration form a bit.

In Drupal, there are two modules that can help you to accomplish this:

Migrating a Drupal site between servers via Drush

As of Drush 4.5, migrating a Drupal site between servers became much easier. The new, little-known drush archive-dump and drush archive-restore commands make it an essentially three step process.

Adding first and last classes to your field items

By default, Drupal's core field.module with add 'odd' and 'even' classes to your field items, but it won't add 'first' and 'last' classes! This can quickly be remedied by overriding the core field.tpl.php file with your own custom one.

Import form values from one form to another via AJAX

Drupal 7's new and improved Form API makes using AJAX a breeze. It enables you to add, replace, or remove form elements via AJAX without ever really having to get your hands dirty.

Regex to swap piped key|value pairs

It's always useful to write down your regexs!

Creating a full screen, resizable slideshow in Drupal

The Views Slideshow module makes the process of creating a slideshow in Drupal extremely easy, but I've always found one important feature to be missing: a fullscreen setting.

Theming Faceted Search result

The Faceted Search module produces a result set that looks almost exactly like Drupal's core search results. However, it does not use the search-results.tpl.php file. Rather, it uses it's own theming function: theme_faceted_search_ui_search_item().

You can, of course, set your own theme function to override this.

Here's a quick example of how I modified the way that users are displayed in the results:

Pages

Subscribe to Front page feed