I was tasked with maintaining a Drupal website that had 44 views. The template.php file for the theme was unwieldy. I spun off all the views template code into another file for ease of maintenance, but it was still 1333 lines1 weighing in at 36.5kb! [1] Just four more lines and it could have been elite!

The quantity of views certainly wasn't pretty, and when I had to add in another view, I decided that enough was enough. It was time to clean it up and develop a system to help keep the views under control.

Recently, I had to make mass changes to nodes while adding a new feature to a live website.

In one case, I wanted to add a date field to a content type with hundreds of existing nodes. For the sake of simplicity, best date that could be used for this field was the created date of the node. With that information, I was able to write the following script to replace any empty date fields with the created date.