Archive for the ‘Uncategorized’ Category

Add multi level search to your website using SPRY

I have been working on a project recently that required me to build a multi level search feature, you know the kind of thing where on selecting the first item in a list of options, the next level becomes available.

One thing you really need to get this working is Ajax. You don’t want to be having full page reloads as each selection is made, wouldn’t it be cool to just update the next selection box?

Now no doubt there are many ways to skin a cat but to be honest

1)There are few (if any) out the box scripts on the web to do this that I could find

2) I am a great believer in not reinventing the wheel and KISS (Keep it Simple Stupid!)

3)Most purely javascript scripts I could find “cheated” in that they pulled down a predefined list of data to the browser and used client based scripts to sort and filter it. This is Ok I suppose in a static environment but its not terribly flexible for a dynamically driven site, and if you have a lot of data to be sorted, as potentially I do in my project,you are dumping the whole list for the user to ultimately choose one item. Better to send only whats needed.

For this reason, and for the reason that its handy and available in DW4 as it comes out the box, I decided to use Adobe’s Spry Javascript Framework. DW4 is a pretty expensive package but there is a free trial version for 30 days use if you want to use this, or if you are a student you can get the package (for non commercial use ) for much cheapness- relative to what it costs me!!!

There are a few frameworks out there, Spry, jQuery, Scriptaculous, prototype, but for me Spry was most accessible  as fundamentally I am a non Javascript developer and I have some experience of its use through other projects.

If you don’t have Spry now and you want to follow along, go to Adobe’s website and download the files. In DW4, it loads up the files you need as you use each function, but if you are not using DW4, feel free to dump the whole package on your server in some folder.

For this example I will use a directory called /spry but it can be anything you want.

If you are bandwidth constrained, you can get a minified version of the files too, this reduces the amount of code being sent to the browser, it does not make much odds on a quiet website, but in a busy case it might save you considerable bandwidth fees down the line.

So with the basis of this project set before you, get the bits you need here and next time I will show how I got the multi level search started.

My assumption is you know a little php to run a database query and know how to get that out the database into xml format. For this project i will be using static xml files.

…and Air France!!!!!!

Jeez what a carry on this mob are.

I thought e tickets and self service check in’s were supposed to be the way to allow you to check in quickly. Not with Air France its not!

Was at Charles D’Gaulle transferring from a flight from Krakow to Edinburgh and as they were two different airlines ( LOT then Air France) needed to get bags and check in with AF.

Went to the appointed check in area (looked like a terminal 5 lookalike sort of place, maybe new and found the check in area. There were some check in machines somewhat like the standard ones you see in UK. Checked in without problem then was sent to the baggage drop area.

Now the airport was not busy (IMO) and the bag drop area was quiet, in fact myself and some travel colleagues were second in the queue, but we waited and waited and waited, and the queue grew longer and longer. There was only one baggage check in woman there and it seemed she was taking a lifetime to get peoples bags onto the system.

Eventually- and I mean like 20 minutes later, she called one of my colleagues forward, we were all heading to different end destinations so there was no point in confusing the issue by all checking in at once.

Just as the last of them checked in and it was my turn, I went forward and handed over my boarding pass. There was a look of consternation on the lady’s face and she started hitting the machine that issues the baggage tags. A few opens and closes of the lid, she said something to her neighbouring colleague in French then she says, sorry machine is broken wait here and when my colleague is free she will serve you. The other lady was doing the AF passenger with frequent flier status – the posh queue.

Lady number one picks up her stuff and leaves- leaving everyone and the queue, and me at the desk.

So now we have two queues growing. Why she could not simply move to another desk I don’t know there were loads free.

So I wait and wait, this time there were three English women (looked like very ex footballers wives and their granny) one of whom had obviously asked for assistance to the plane. Dunno why they all looked well enough to walk, I sometimes think this is a scam to get the party on the plane ahead of the queues, but maybe I am just cynical.

Anyway it came to a question about do you want to go into departures now or wait until half two and come back and someone will help you with the wheel chair.

Hmm lets seeeeeeeeeeee ……….. 5 minutes thinking about it………… hmm maybe we will come back…………… hmmmm 5 minutes discussing, the queue is getting longer…………….. and longer…………….. hmm maybe we will go through now…………….. hmmmmm …… longer………… We will………. hmmm .. maybe phone a fekking friend??????

This was mental, I was getting well hacked off and the two queues, scum (like me) and WAGs, like them , sort of were now easily 30-40 people long each.

They made their choice eventually and wandered away- I saw no need for a wheel chair.

So she says, OK I will take you now, I stepped to the front of the desk and put my bag on the weighing machine- “please remove the bag from the machine I am still dealing with the previous customer”, I whispered an oath under my breath, but not under my breath enough cos she heard me and started to take a strop at me, so I apologised, blaming my frustration, after all I had only been waiting about 40 minutes to check in a bag (from near enough the front of the queue)

She calms down and does my bags- have to be honest I expected it to be sent o Azerbaijan or somewhere! One of my colleagues bags though was still stuck on the conveyor of the first desk, having been left there by the first lady who cleared off, so I asked the second lady to move it ontot he main conveyor, after all it could get lost, she was not happy, but she did it …. what a bunch of trolls……

Bluestone-online
Categories
Affiliates