Web Development BlogWordpress Widget Context on localhost
I often develop sites on my local machine before committing and transferring to a staging/live server, so during the development phase most of my sites reside on a URL similar to http://localhost:8800.
Tue, 17 May 2011 14:11:00 +0000http://jamesmorrish.co.uk/blog/wordpress-widget-context-on-localhost/Change the first row of a view in Drupal
I was just developing a Block View in Drupal for a freelance project, where the markup on the first row was different to the subsequent rows. I needed to change the markup to display an image and teaser, while the subsequent rows just has the title (which links to the node) and published date.
Wed, 13 Apr 2011 13:01:00 +0000http://jamesmorrish.co.uk/blog/change-the-first-row-of-a-view-in-drupal/IE9 Hell(vetica)
On Tuesday I eagerly downloaded the new version of Internet Explorer, hoping that this version would be a turning point for the browser. I hoped this might be the end of IE’s inconsistencies, the start of Microsoft conforming to web standards, and the death of IE-specific style sheets.
Sat, 19 Mar 2011 10:16:00 +0000http://jamesmorrish.co.uk/blog/ie9-hellvetica/Sort a view using arguments in Drupal
Being able to sort a view using URL parameters seems like the most basic functionality, but it seems this is not possible using using views without some kind of module. I have to say Symphony handles this much better than Drupal.
Thu, 10 Mar 2011 12:47:00 +0000http://jamesmorrish.co.uk/blog/sort-a-view-using-arguments-in-drupal/Get the image path of a CCK file upload field in Drupal
I often like to use template files to alter the HTML of a view to cut down on the masses of redundant markup that Drupal creates. But I just came across a problem where I was unable to get the file path of an image in my content type, despite the fact that the image was output in the view settings.
Tue, 08 Mar 2011 14:59:00 +0000http://jamesmorrish.co.uk/blog/get-the-image-path-of-a-cck-file-upload-field-in-drupal/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
Wed, 23 Feb 2011 18:30:00 +0000http://jamesmorrish.co.uk/blog/should-websites-look-identical-in-every-browser/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
Mon, 21 Feb 2011 18:25:00 +0000http://jamesmorrish.co.uk/blog/using-raquo-in-a-submit-button-using-hook-form-alter/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
Fri, 18 Feb 2011 09:00:00 +0000http://jamesmorrish.co.uk/blog/exposed-filter-date-field-format-in-drupal/Using jQuery Cycle to load images on the fly
I use jQuery cycle for lots of freelance development projects, but ran in to problems recently when building a photography site. My client was uploading around 40 high-resolution images in to a slideshow, which caused two problems
Tue, 15 Feb 2011 22:41:00 +0000http://jamesmorrish.co.uk/blog/using-jquery-cycle-to-load-images-on-the-fly/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.
Tue, 15 Feb 2011 13:04:00 +0000http://jamesmorrish.co.uk/blog/get-a-clean-array-of-primary-links-in-drupal/