Bright Blogs

Setting up email subscriptions and notifications in Drupal 7

Email notifications are the glitter of community sites: very few people passionately like them, but you'll never get rid of them. Probably the most typical use case on a Drupal site is to send an email notification to let a node's author know that someone's commented on their node. I just spent the good part of an afternoon setting this up on a Drupal 7 site, and thought I'd pass along some time saving tips.

IE Blew Up My Layout!!!

We've all experienced it, you've themed out a page and it looks fantastic in Firefox. Unfortunately the time has arrived for your IE testing... You've dreaded it the entire time and have put it off. You fire up your windows testing environment and your worst nightmare has come true. The entire layout is blown out. Divs are strewn about like your tpl.php ate a hand grenade.

Don't Repeat Yourself: Enterprise Data is Hard

I usually like what Ted Dziuba has to say but his rant, The Most Important Concept in Systems Design, missed the mark on a few points and ultimately misunderstands the problem on a fundamental level. Go read Ted's article if you haven't already, then we'll jump into some counterarguments and finally why the whole rant is misguided.

How to use Apache's Proxy on Drupal's Files directory

Drupal's files directory can get enormous, and it's best not to keep it in version control. Here's a way to use Apache's proxy module to point your local environment directly to your dev/live site's files directory so you don't have to download it.

In your httpd.conf:

  1. ProxyRequests On
  2. ProxyVia On
  4. <Proxy *>
  5.     Order deny,allow
  6.     Deny from all
  7.     Allow from localhost
  8.     Allow from all
  9. </Proxy>
  11. <Location /sites/default/files/imagecache/>
  12.    ProxyPass
  13. </Location>

Quick steps to debug your module's css

Someone on the Drupal Dev list asked what to do when his custom module's CSS wasn't showing up. This is the quick checklist I sent in reply:

In order:

0. Make extra-sure your module's enabled on admin/build/modules

1. Check your drupal_add_css() call. Should look roughly like:
drupal_add_css(drupal_get_path('module', 'MYMODULE') .'/css/MYMODULE.css');

2. Make sure you're doing drupal_add_css() inside hook_init()