Web Development by Alistair Robinson

« Blog home

Posts Tagged ‘jquery’…

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 »

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 »

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 »

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


August 11th, 2009 No Comments

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 »


©2010 Alistair Robinson