Web Development by Alistair Robinson

CSS Abstracted


May 1st, 2010 2 Comments

Half way through the development of my last site I decided to use PHP files for CSS. I had a few stylesheets, and I found I was constantly going from one to the other to copy and paste hex colour codes. And then later, if I wanted to change a colour, I’d have to change it in all those different places. That really is no way to work.
The answer to this, of course, is variables (or constants), so that you can define your colours in one place. Trouble is, CSS don’t got none. In fact, CSS is lacking in several important ways. What it boils down to is that we struggle to get around the fact that CSS doesn’t work … read on »

The Resources of The World Are Limitless


March 26th, 2010

I struggled to come up with a web development angle for this one. I had a brief hope of executing some dazzling metaphorical sleight of hand when I read Thomas DeGregori’s discussion of the “usability” of rocks among proto-humans, but in the end I gave up and decided just to roll with it…
The world’s resources are limitless. I’m not joking. In a world of finite materials – and a finite 88 keys on a piano – resources are no more limited than are melodies and harmonies. Even if we stick to the Western musical scale, we will never run out of tunes. This is because tunes are not raw materials, somehow just there, waiting to be discovered: they come into … read on »

A Nice and Simple Photo Gallery Solution for MODx


February 25th, 2010 10 Comments

My third MODx site is about to launch. It’s relatively simple (no forms!) so I had the chance to really concentrate on refining my architecture, and the work I’ve done will stand me in good stead for a while (unless I give in to the enticements of SilverStripe or ExpressionEngine, or just ditch the PHP altogether and finally get up-and-running with Django).
“Refining his architecture? What does he mean?” For me, learning to use MODx well has been about working out how to combine templates, template variables, chunks and snippets in a logical and efficient structure. A good application – a small one, at least – should have a shape that you can envision (if you’re the kind of person who … read on »

The Magical MODx ManagerManager Plugin


January 13th, 2010 4 Comments

My first MODx-powered website went live today, and my intention now is to share some of my experiences. From a development point of view MODx is so flexible that there are several ways of doing most things, so if like me you constantly fret about your architecture and constantly refactor your code for re-usability, you might be confused about just what is the best way of doing things, especially if you’re just starting out. So in this and forthcoming posts I’ll be discussing some of my development techniques.
This post is mainly an introduction to the ManagerManager plugin written by Nick Crossland. In my opinion it is absolutely indispensable, unless you’ve come up with your own way of doing the same … read on »

FoxyCart: Replacing A Cart Item


December 14th, 2009 1 Comment

function add_pre_process() {
  //Find the id of the existing registration in the cart, if it does exist
  $.each(fc_json.products, function(key, product) {
    if(product.name=="Registration") {
      // Do the remove request, with parameter quantity=0
      $.ajax({
        async: false,
        type: "GET",
        url: "https://mydomain.foxycart.com/cart?output=json&cart=update&id="+product.id+"&quantity=0&callback=?" + fc_AddSession(),
        dataType: ‘json’
      });
    }
  });

  // Add the new one
  add_item();
}

function add_item() {
  //Get the form data
  var submitted_data = $("#signup").serialize();

  //Do the add request
  $.ajax({
    type: "GET",
    url: "https://mydomain.foxycart.com/cart?"+submitted_data+"&callback=?" + fc_AddSession(),
    dataType: ‘json’
  });
}
This javascript/jQuery code gets the contents of your cart (which is in the variable fc_json, made available by foxycart_includes.js), removes any item whose … read on »

Web Development Frameworks: Developing For vs. Developing With


December 10th, 2009 4 Comments

I’ve been hunting for a web development framework for a few months. Back in the summer I was immersed in CSS and javascript, just sticking with my tried and tested server-side techniques. Using the TinyButStrong (TBS) template class I could put together a highly organized dynamic website pretty quickly. In retrospect it seems that I’d found my own path towards an MVC-like pattern: nothing but HTML and logic-less TBS tags in the templates; PHP pages acting like controllers, for form processing and manipulating data; and a class for each table in the database (more or less). Very neat. Framework junkies amongst you could tell me exactly why this isn’t really MVC, but I don’t care.
Anyway, my first intention was to … read on »

Web Development and Chopping Garlic


December 2nd, 2009 1 Comment

For this post it was a toss-up between:
1. My observations on Freud’s Psychopathology of Everyday Life (boiling down to my realization that I’m a tangle of complexes, but also that I’m actually doing alright and won’t be running to an analyst any time soon)
2. A vague and geeky ramble over the broken, scarred and unstable terrain of web development.
Since moving this blog over to my website, I’m conscious I may be losing those who enjoyed such posts as Sweaty Rectangle and My 25-year-old Earworm, but the geeky ramble won out this time. Bear with me though: I am large, I contain multitudes.
Though I’ve been doing web development off and on for ten years, I’ve never been as enthusiastic about it … read on »

A Paradigmatic Project: Building a Flickr Gallery with PHP, jCarousel and Lytebox


August 11th, 2009

Don’t re-invent the wheel. That’s a motto that every good programmer and web developer lives by. If we’re being creative or original it’s usually in knowing which components and scripts to combine, amongst all those that have been created by other people; and in knowing how each of those components can be tweaked and configured to produce a good solution.
In web development this amounts to a synergy of languages, APIs, engines and interfaces working in blissfully ignorant harmony to provide rich functionality. This is the beauty of web development in the age of its blooming youthfulness, following the awkward stumblings of its infancy.
Incidentally, I think this is the characteristic of this kind of work that conventional programmers, or software engineers … read on »

Review: Zappa Plays Zappa Plays Edinburgh


July 26th, 2009

I don’t often walk the stretch of Lothian Road between the Usher Hall and St John’s, but for a reason I can’t remember, that’s what I was doing one morning in May, and if a higher power was responsible for this circumstance I’d just like to thank him or her or it.
For that was how I came to see out of the corner of my eye that unmistakeable symbol, “ZAPPA”, on a poster amongst other posters clustered around a door. I jerked to a halt and exclaimed out loud, “Jesus!” The door turned out to be that of the HMV Picture House – which I didn’t even know existed – and the poster was advertising the upcoming tour date – … read on »

Artists, Please Expand Your Horizons


July 22nd, 2009 8 Comments

Two Horizons is the name of an exhibition at the Scottish National Gallery Of Modern Art that I went to recently, but my topicality is lacking again because I notice it has just ended. No matter: I went so that you don’t have to, and I’m eager to share my thoughts – but that’s probably only because it gives me the chance to have a rant about conceptual art.
Taken from a private collection of fairly new art, it was a mixed bunch. I enjoyed a few of the pieces (but, let’s face it, good reviews are boring, so feel free to skip a few paragraphs.) Marc Camille Chaimowicz’s Man Looking out of a Window and Arch together were fascinating. The … read on »


©2010 Alistair Robinson