1. Skip Navigation |
  2. What's New |
  3. Search |
  4. Contact Me |
  5. This Site
29 November 2005  

Dynamic Menus - a pain in the arse

11:50 PM

After reading JonTan's Automatic Breadcrumb Creator Script on AccessifyForum, I thought hmm... what a neat idea.

So I unpacked my coding head, sat down and thought about it. I've just redeveloped my site. Wouldn't it be nice if rather than some static menu, the page automatically determines by itself where it is in my site and marks up the menu navigation accordingly? Yup, that'd be cool.

It can't be that difficult to do, can it?

Well, that depends. The draft that I use on the blogger part of my site wasn't. But this relies on a) knowing the part of the site these pages are found in and b) not marking up the actual hierarchy properly if you're looking at an archived post. But it does look at the rest of your directories. Or at least the ones I've specified in an array (so it doesn't spit out robots.txt etc). It will index the files it finds at the next level, but only manages to handle two directory levels. So far, so middling.

Well, it's a start. The next stage is to make it work recursively. This is more of a problem than I'd first envisaged because you don't know how many directory levels you've got, so you've got to create and use dynamically named variables. Which is where the whole pain in the arse thing comes in.

There's also the minor side issues of getting the damn thing to output valid XHTML and not spit out <ol> tags whenever it damn well pleases, but I've pretty much got there in the end. I'm currently in the process of documenting the procedure, in case it's of interest to anyone else and will include a link here when I'm finished.

Incidentally, if anyone else can follow the program logic, well done. I can just about work out what it's doing and I wrote the darn thing.

0 comments on permanent link


21 November 2005  

AcFo Expo Manchester 05

9:02 PM

It was a dark, stormy night. Oh, all right. It was a slightly chilly but relatively bright lunchtime. The wind whistled eerily along the deserted platform as hordes of geeks descended upon Manchester Piccadilly. But then I felt it! A disturbance in the farce. Setting phasers to stun, I checked again. Still no sign of a woolworths. Was this some elaborate ploy by the AccessifyForum moderators to round up those members they didn't like the look of and bump them off, one by one?

But no, a gaggle of geeks had made a corner of the station next to WH Smiths their home, and as I joined them and asked for Woolworths it became apparent that these weren't just any geeks, these were the other lost AccessifyForum geeks on their way to what must surely become known as the ACFO 05 Winter EXPO. And what was to be revealed here? Surely it could be none other than BETA of "I'm feeling stalky". More later. Those present were danchamp, JackP, redux, vigo, asaxton, pixeldiva, Robert Wellock and garethr (eventually).

I'm going to persist in referring to these people by their forum names, as I'm still not convinced they are actually real people.

Imagine the scene, then: seven people and one wheelchair trying to find their way from Manchester picadilly to some bar somewhere with wi-fi, our tour guide being the inimitable Redux who despite being our Manchester host was doing his best to convince us that he'd not actually been to Manchester before "well, I thought it was a woolworths". "oh, I didn't think it was that bar, I thought it was the other one", "which way do we go from here?". Indeed. Robert kindly tried to direct us in front of a bus, but sadly for him we're all used to our so-called mates trying to bump us off so we managed to avoid it.

Eventually our scouting party made it as far as the font bar which we were pleasantly surprised to learn was wheelchair accessible - unlike many of manchester's kerbs. However, there was no indication on whether or not you could resize it (little accessibility joke for you there). There I discovered the delights of 'bager'. This is what you get when you start with a pint of bitter, Redux drinks some of it by mistake and then kindly tops it up with his lager. Mmm. Just imagine. Now stop before you feel ill.

They had for some reason decided that Redux had "friends" and had placed signs on two tables reserving them for "Patrick and friends from 12:30". Who's this Patrick, then? Naturally we ignored these and piled onto one table elsewhere, watching England draw with Brazil 0-0 on some football game being played on a giant screen in the corner. Unfortunately, the game itself lasted only five minutes but the replays of it (from only six different points in the match) were shown on for the next three hours. How he missed that sitter I'll never know.

Next, Redux spent £18 on a wireless connection showing us pictures of Japanese girls in pink who seemed to think they were some sort of fashion icons when in reality they, well, let's put it this way - it was deemed to have sufficient entertainment value to spend £18 on showing it to us, when there wasn't anything dubious about it other than the "fasion" sense. There was then a brief rant about the some organisation or other whom I'm not allowed to mention led by asaxton and Redux, which resurfaced at various points through the day. The main thrust of this was that if you turn up and give a talk saying how good you are for developers and how open you are but you're not allowed to give anyone any specifics or let anyone see your demo site then, well, then you're talking nonsense. We also had a business card from some guy called 'Kitkat'. Apparently 'FingerOfFudge' wasn't available that day. Also, Garethr turned up.

At this point I went to the toilet. I wouldn't normally think this worthy of mention, only I wanted a shorter paragraph here and I thought that'll do.

When I returned we'd moved tack slightly - it was now time to order food. Smashing. I thought I'd go for a burger and chips and as danchamp was ordering I just gave him my money and said what I wanted. The pub guy asks me if I want wedges, curly chips or chips. Oh, any sort of chips, I say. Now, to my mind, that would mean "either curly chips or chips". Obviously I don't understand the Mancunian mind. The barman replied with "I'll give you wedges then, it'll be easier since he's having them". Um... okay. It's not what I was asking for but I didn't like to argue at this point. The wedges were actually very nice, and fortunately I did get my cheeseburger as opposed to the barman deciding that something else would be easier.

And on to google. First of all, we contemplate how easy it is to find someone on google - ex-partners etc because google appears to know absolutely everything. There is then a suggestion on it being a stalkers paradise, which prompts asaxton to suggest the marvellous "I'm feeling stalky" button. Obviously you'd have to type in your own postcode so you could get someone nearby - there's no sense in traipsing to the opposite ends of the country now, is there? Feel free to insert your own witticisms here. They would no doubt be better than ours. Apologies to the thousands of people no doubt offended, but it wasn't my idea. I'm merely reporting it, 'kay?

After some further consumption of drinks, it was time to head back to the station and/or hotels to check in, or go home so the missus can go and see Harry Potter as appropriate. danchamp showed his willingness to "help" - as garethr was staying in the same hotel as him - by sending him off down the wrong street. Following the moderator's example, I presume. I had no idea where my hotel was, although I did have a map printed from the internet with it on. Unfortunately it didn't seem to have any of the streets on that we were actually passing as a starting point. Various people offered their opinions as to which direction it was, but being a wise old head and having played this game before, I knew it was only a few minutes from the station, and there was a map at the station. I therefore decided to follow the others back to the station.

We had arranged to meet Redux at some pub back at 8:30, so there rest of us were going to get some food first. Arriving at the station at 5pm, I arranged with the danchamp, pixeldiva and garethr to meet them back there at 5:45 - that should give me plenty of time to find my hotel ( "it's only five minutes away"), check in and get back to the station. After all, I had my map, and now I had the station map. Only it turned out that's what it was. A map of the station. Not really the surrounding area. Bugger.

Oh well, get a taxi. In a taxi, out of the station, turn right, move forward about 500 yards, there you go. Okay, so I could have walked in less time than I'd queued for the taxi but only if I'd set off in the right direction. And at least I knew which way to go now. Check in -hand over money - get room key - go to room - put bag down = (toilet again, if you're interested) - leave room again - head back to station. In plenty of time. Found Garethr. Danchamp found us and led us up to the station bar where Pixeldiva was rapidly transforming a bundle of wool into something knitted. How, I ask you, is anyone expected to maintain a geeky reputation if they knit? Next she'll be getting out in the fresh air now and again or something. Still, at least she's got the sci-fi to fall back on.

Onward, onward and upward. The valiant four struggle out through the foul, depressing Manchester evening weather (if I just say "it was a bit cold" it's less impressive) and head in search of food. Consideration is given to a Japanese restaurant but as we aren't sure what the menu involves we move on and eventually settle at the Grand Buffet. Which is basically a case of help yourselves to platefuls of Indian food. That did the job nicely.

We stop by a cashpoint where danchamp and pixeldiva go to get some more money out and Garethr and I get to watch one of those lovely comedy moments. You know, where someone who's had a bit to drink decides to make a really witty comment to a policeman. Unfortunately, that was about the limit of the entertainment as the chap wisely decided not to push his luck and sauntered off. Not really worth mentioning, was it?

Then we migrate down to the Salisbury near Oxford Road train station, which sells Theakston's Old Peculier. 5.7% ABV. Lovely stuff. The only problem is it makes you start talking nonsense. Which, given that I probably wasn't making much sense to begin with it not necessarily a good thing. Poor Danchamp was subject to the rest of us and our rants about loud music as the pub was basically a rocker's pub and the awesome Rage Against The Machine seemed to feature quite heavily. As the Old Peculier continued to work its mighty power, I recall having a conversation with danchamp about ghosts, religion and the decision to teach intelligent design alongside evolutionary theory in American classrooms. I mean, why? Okay, at least it wasn't talking about websites for five minutes...

Redux managed to turn up, cleverly timing his arrival while Garethr was at the bar. But Garethr wasn't out of pocket, no, the wily scamp had cleverly gone to the bar with danchamp's money, thus ensuring he could happily buy Redux a drink to score himself forum points at no monetary cost. Sneeeaaaky.

And then, at about 11:15pm, I was the first one to leave on the basis I've got two small kids so I'm obviously getting old and I can't stay up with the young 'uns like I used to. Fortunately I still had enough wits about me to move out of the way of a car doing a handbrake turn at about 60 mph on the way back to the hotel. Somebody up to no good, I'll be bound. Fortunately my sense of direction - once I know where I've got to get to - is pretty good and I made it back to the hotel. To find the front door locked.

Ah, I thought, does the room key open the front door as well? No. Hmm. Oh, hang on, there's a buzzer. I'll press that. Press buzzer. No response. Various drunks walking past looking at me. Wait a bit longer. Press buzzer again. "Yes?" Um... I give my name and my room number and am allowed in. Warmth. Lovely. Hotel bar. No, I shouldn't, I really shouldn't, I've come back because I'm tired. But match of the day is on. So I stay to watch Sunderland get beat (fortunately I'd already missed Newcastle's loss) and then head up.

And that, gentle reader, was the AcFo Winter 05 ExPo

0 comments on permanent link


This page is powered by Blogger