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.

Overview

A basic Drupal site is made of two fundamental elements: the codebase and the database. When you migrate a Drupal site, you need to migrate both of these elements, often with a bit of re-configuration to boot.

Drupal - Conditionally hiding CCK fieldgroups

Conditional Fields is a great Drupal module for conditionally hiding CCK fields.

Unfortunately, it can't hide CCK fieldgroups. It's also not ideal if you're concerned about security— it simply hides fields; it doesn't deny access. A recent project of mine required that I conditionally deny access to field groups, so I decided to implement a programmatic solution.

In this case, I needed to deny access to specific fieldgroups in content type 'company' based on:

Drupal - overriding filefield theming

Drupal's default 'Generic File' format can be a bit ugly. Luckily, it's not too hard to override. If you'd like to change the default filefield theming for 'Generic File', try using the theme_filefield_item() function in your template.php file.

Note: You may also be interested in checking out my post on customizing the filefield format in views.

In the example below, I overrode the default theming for all cck fieldfields belonging to node type 'publication'.

Using imagecache with the Image or Embedded Media Field modules

Actually, there is a way to use imagecache presets with the image module without patches. It involves creating a View that manually applies the imagecache preset to the image field (not imagefield). You'll need views customfield.

Create a view and add the relationships "Image:File" and "Image:Node." Then add fields "File:path," "Node->title," and "Customfield: PHP Code." Add this to your php customfield script: