code

I have chosen to censor news.google.com

I'm pretty sick of sensationalist news stories about crime and car crashes so I've written a GreaseMonkey script which hides them from me when I'm using http://news.google.com

You can get the script from http://userscripts.org/scripts/show/75346

Read more

Tired of nzherald.co.nz splitting articles across multiple pages? You need this

Tagged:

I've written a wee Greasemonkey script which detects when you're looking at a nzherald news article that has multiple pages, and redirects you to the version of the article which is a single longer page.

It's my first Greasemonkey script. I already know Javascript, so it was really easy especially with this fantastic free book on the subject.

Enough of my yammering. You can download it here.

Read more

Using links properly

Tagged:

I see things like this all the time. Both in content that clients have put into their CMS, and on major web sites where the editors should know better.

"Click here to download our document about xyz"

Our cool software can be downloaded here"

Read more

theming just one node in drupal

Drupal's theming system uses file names to decide which theme to apply to whatever page the visitor is asking for. So  page-front.tpl.php is the front page, block-footer.tpl.php is any block in the footer, page-node-10.tpl is the page that contains node 10, etc etc

However, out of the box, there is no way to theme just one node. You can't go node-1.tpl.php and expect node 1 to be themed. To get around this, add the following to your theme's template.php

function phptemplate_preprocess_node(&$vars, $hook) {
  $node = $vars['node'];
Read more
Syndicate content