Web Development by Alistair Robinson

Fear and Trembling


March 3rd, 2010 No Comments

It is facile to mock or criticize philosophy for its difficult language, and I like to think I’m not a facile thinker, but I had an “oh sod this” moment while reading Kierkegaard this morning. The obscure, tangled, repetitive and willfully paradoxical language is just tedious – at least, so it strikes me so far. I know a little bit about philosophy: I’ve read some Plato, Hume, Nietzsche, Bertrand Russell, and recently Roger Scruton. So I can be quite confident that my repugnance is not a knee-jerk reaction to difficult arguments. I don’t know, perhaps it just isn’t to my taste. Like Nietzsche, it is rhetorical and poetical rather than clear and elegant. I suppose that you can find truth, … read on »

Wordpress Woes and Upcoming Redesign


February 26th, 2010 No Comments

Update (March 15th): Since writing this the redesign and hosting move have both happened, and things seem to be running quite smoothly. And this time I installed Akismet rather than WP Spam Free to deal with the spam.
After my last post, in which I briefly sang the praises of Wordpress, I became increasingly troubled by the horribly slow page load times of this blog, so I spent an hour or two last night trying to speed things up. It’s a while since I installed WP Super Cache, and all this time I’ve been thinking that my troubles were over. I even tried pretending that the occasions when it took 10 seconds to load a page were just freak occurrences, only … read on »

A Nice and Simple Photo Gallery Solution for MODx


February 25th, 2010 9 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 3 Comments

My first MODx-powered website went live today (Pinnacle Telecom Group plc), 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 … 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 »

I Undressed Her by Mistake


December 4th, 2009 No Comments

Freud’s Psychopathology of Everyday Life reads a lot like today’s popular science books. In particular it reminds me of Musicophilia by Oliver Sacks, with its conversational style.
Much of the pleasure is the spectacle of all these Viennese doctors revelling in the exciting new theories of psychoanalysis, sharing their little anecdotes. Writing about inadvertent actions and how they can reveal unconscious motives, he quotes another psychologist:
“I entered someone’s home, and gave the lady of the house my right hand. Oddly enough, in the process I untied the bow holding her loose morning dress together. I was not aware of any dishonourable intentions, yet I had performed this unskilful movement with a conjuror’s sleight of hand.”

Chemicals and Complexes


December 3rd, 2009 No Comments

As I wrote in the last post, I’m a tangle of complexes. Why didn’t I know this before? Lately I’ve been examining how my own self-awareness has changed over the years. I suppose you could call this self-awareness-awareness.
For years I would sometimes have bad moods of a particular kind, and during those moods my thoughts would turn to violence. Sometimes while walking in town on my way to or from work I would slip into a self-righteous rage, but lacking a very good reason for it I would fantasize about people offending me more than anyone in fact was doing, and about what I would do to them if this happened (normally involving a beating of some kind, but nothing … 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 »

New Work


November 14th, 2009 No Comments

This is a taster of what’s to come in a few weeks. I’m building this website, for the Scottish Golf Heritage Festival, with an array of incredibly useful components and features: I’m using the MODx content management system, FoxyCart for an integrated shop and registration process, and a wealth of snazzy (I’m certain I can make that word cool again) rich interface components. I’m particularly looking forward to building the graphing functionality for the admin system, for which I’m probably going to use the gRaphael javascript library.
The holding page, two screenshots of which are shown above, is the result of a lot of work in establishing the general layout and style of the forthcoming site. It combines several approaches to … read on »


©2010 Alistair Robinson