February 2011 blog posts

Should websites look identical in every browser?

Throughout the course of my web development career I have debated this point with project managers, designers, clients, and even other web developers, who have argued that websites should look identical in every browser. There are several reasons that is impossible ...

Date
23rd February 2011
Tags
HTML, CSS
Read more »

Using raquo in a submit button using hook_form_alter

I just got stuck trying to add a raquo (») to a submit button using hook_form_alter in Drupal. I tried altering the text of the submit button as follows: $form['submit']['#value'] = "Submit »"; $form['submit']['#value'] = "Submit »"; but both of these methods resulted in the ampersand being escaped in the HTML ...

Date
21st February 2011
Tags
Drupal, PHP
Read more »

Exposed Filter Date Field Format in Drupal

I just had a problem with the date field in an exposed filter in a Drupal view, using the popup form type. Regardless of the site configuration date format, the exposed filter will always default to the format Y-m-d. I ended up fixing this by creating a new module, and wrote a simple function using the form_alter hook ...

Date
18th February 2011
Tags
PHP, Drupal
Read more »

Get a clean array of primary links in Drupal

I have had to develop a couple of Drupal sites recently where I needed to grab the array of Primary Links and do something bespoke with it. Drupal provides functions for this, but they return so much data it can be difficult to work with it, particularly when you have large menus. ...

Date
15th February 2011
Tags
PHP, Drupal
Read more »