Skip to main content

Create different messages per content type with Drupal's Messaging/Notifications framework.

A recent project required me to create a different notification message per content type. To do this you can use the hook_message_alter() function to override the default message. I borrowed heavily from the code in file_message_alter()

The code I used is below:


Multi-dependent select elements in Drupal 7 using ajax

Recently I needed to modify a Drupal 7 node form to have two drop down select elements populate based upon a third select element's choice. I have altered select elements in the past to have a single dependency, but never have I made one element control the content of two different elements.

To start, I made the first element control the second (the old familiar way):

I need the selection in field_dropdown_1 to dictate what appears in the list for field_dropdown_2 and field_dropdown_3.


Migrating a Drupal 5 site to a Drupal 7 site.

I had to accomplish the task of migrating the content from a Drupal 5 site with 10,000+ nodes to a new Drupal 7 version. The caveat was that all of the node information needed to remain intact due to various links that were entered into the body of posts. My initial thought was to use a .csv file and import directly into the database. After some more research I discovered the migrate and migrate_d2d modules.


How to form alter Ubercart 3 Address Pane Fields

I recently needed to alter the address fields within the Ubercart 3 billing pane. Unfortunately, due to the way Ubercart 3 builds these form elements, the standard hook_form_alter() hook was not going to work. After a few hours of searching I finally discovered this post:

https://drupal.org/node/2063949#comment-7750227

With that information I was able to alter my billing pane's company field into a select list taken from a taxonomy. The code below was entered into my theme's template.php file.


Get the Aegir Platform path when editing a vhost

I was setting up a static mobile website for a Drupal site that was installed within the Aegir hosting environment today. We had been given a static mobile version of the website to load. So, we added the mobile site to a directory within our theme and we needed to setup an alias for this site. To accomplish this we created a new mysite.drush.inc file within the .drush folder and added the following code:


How to: Migrate an EC2 instances to a new availability zone

Recently an EC2 instance we were using in a production environment was scheduled to go down for maintenance. Normally this would be fine and we would let AWS just handle this. However, their scheduled maintenance window was set for 21:00 UTC, which equates to 17:00 EST. In other words, right at the end of the work day. Not cool!

In order to use a maintenance schedule of our choosing, we had to migrate our production instance into a different availability zone prior to Amazon's schedule. So, we setup a test instances and tested migrating. Our successful steps are below:


Export Illustrator to Photoshop while maintaining layers and groups

We received a website design from a client's graphic designer in an Illustrator format. We tried exporting the file to a Photoshop file and the .psd would never maintain layers. After struggling to slice out of the illustrator file, we finally stumbled across the solution in this comment: http://vectips.com/tips/export-illustrator-files-to-photoshop/comment-p…

To export from Illustrator to Photoshop: