User login

Drupal

HTML5 placeholder via form alter

In a module OR a theme:

<?php
/**
  * Use the HTML5 placeholder attribute to add help text to the search box.
  */
function PROJECTNAME_form_search_block_form_alter(&$form, &$form_state) {
  $form['search_block_form']['#attributes']['placeholder'] = t('enter search terms');
}
?>

Loyalty oath

The phrase loyalty oath was the nicest, shortest way i could think of invoking the evil of the Inquisition, witch trials, and red scares. Questioning people's motivations and intentions, rather than acting on what people do, is a quick way to tearing apart communities and, at worst, destroying lives.

I talk about the movement and consciousness and solidarity, including in a Drupal context— i'm all for being aware of a greater good and doing things for that reason. But if we start questioning everyone's commitment, we're done before we've begun.

CSS and JavaScript aggregation in Drupal 7

stefan:h ave you noticed that javascript and css aggregation does not work as expected on dgd7.org.
17:28 mlncn: how do you expect it to work? they changed it in D7, mostly for the better
17:28 stefan-agaric: there's 3 css and 2 js that seems to be created by it.
17:28 mlncn: there's more files, but they aren't recreated as often
17:28 stefan-agaric: what's the point?
17:29 mlncn: or rather, i should say, there's more files per page but fewer files when browsing around the site
17:29 stefan-agaric: we only need one.

Getting Drupal to copy default.settings.php itself

This'll do it. Highly not recommended.

sudo chown -R www-data:www-data sites/default

On DrupalCon scholarships: We can do better

Wrote this on the post announcing the merit-based DrupalCon Chicago scholarship winners:

With 4,000 attendees

We can do scholarships for 100 people. We can certainly do better than twenty-one.

An Online Account / Social Media field type

You enter your username or ID and check off all the places it applies: Twitter, Facebook, IRC, etc.

There's a bit of a pitfall for places like drupal.org where your profile URL is not based on the username.

Or should it be entirely do-it-yourself?

My username/ID is:
On website:

Making a block example done live at WesternMassDrupalCamp 2011

The most fun lesson learned– passing in a pure integer to the $block['content'] in the implementation of hook_block_view causes an unsupported operand error so deep in the block rendering system the stack trace doesn't even know where it came from.

<?php
/**
 * Implements hook_block_info().
 */
function dgd7glue_block_info() {
  $blocks = array();
  $blocks['twoplustwo'] = array(
    'info' => t('Two plus two.'),
  );
  return $blocks;
}

Use Drush to sync the database from one site to another

Based on Greg Anderson's chapter in the Definitive Guide to Drupal 7.

drush sql-sync @dgd7.prod @dgd7.local

Prerequisites

A dgd7.aliases.drushrc.php file in a ~/.drush directory (that's a .drush folder in your home directory) that contains something like:

Syndicate content