Don't Stress Over Local Passwords

Are you working in a multi-server environment, such as local, staging and production? If you don't have User 1 (or some other user) access in your local setup, it's easy to remedy.

Enter drush and its user-password (upwd) command. Changing a password is a cinch, whether you know the existing one or not, if you have drush access to the site, which you hopefully do, on your local development server.

drush upwd <username> --password="<new password>"

Example:

drush upwd admin --password="let-me-in"

Vertically aligning list items - table déjà vu

Have you ever tried to vertically align a horizontal arrangement of list items, such as a row of horizontal menu items? Did you end up pulling your hair and giving up? The fact is, block items (as defined as such in CSS) are not meant to be vertically aligned, at least not with default styling.

The solution is a return to tables ... well, kinda sort of.

Try the following...then glue your hair back on!

<ul>

  <li><a href="/">Link 1</a></li>

Giving Nodes a Wardrobe - meet page_is_node() and drupal_is_front_page()

If you've been using Drupal for awhile, you probably understand template hinting and how you can format one content type differently than another, by having a template file such as

node--my-content-type.tpl.php

Recently, however, I had the need to format a single content type differently depending on where it was presented: