Roll up, roll up…

Welcome, ladies and gentlemen to the most amazing show this side of the firewall! The star of our show is none other than Chris Taylor, now Officially a member of The Guild of Accessible Web Designers!

That’s right, I was inducted (don’t ask about the ceremony, it was embarrasing to say the least, and left me badly chafed) recently and can now display this logo with pride over any part of my body:

The Guild of Accessible Web Designers logo

So I’m wearing it proudly on my … sleeve :0)

Other attractions in the show include (some of these are thanls to the great M@):

– A motley travelling band of web developers who, in village halls up and down the country, will, in front of a *live* audience, code up a rudimentary CRM application in a matter of hours without the aid of a safety net!
– A daredevil riding on a single-class Javascript application high above a pit of ravenous syntax-checkers!
– A troup of animated GIFs doing the can-can
– Chris himself taming the dangerous and wild Internet Explorer beast
– The hilarious Peekaboo Bug Brothers
– The beautiful and mysterious world of Madame CSS
– A juggler simultaneously keeping 4 browsers in the air, all rendering a single page in completely different ways?
– A lightly greased contortionist extricating himself from a web of Visual-Studio-generated HTML?
– The amazing disappearing !

And for the finale? A thousand abstract base classes released to gently float down onto the audience….. Imagine the gasps!

So what are you waiting for? Tickets are on sale now!

I’m certifiable, apparently…

Today has been a busy, as per usual. However I had a small and pleasant surprise when I started to investigate the Microsoft certified professional courses that are available. After all, I have no qualifications whatsoever in web development (or indeed in anything even remotely technical) so I thought I’d try to get at least one certificate to hang on the wall. A helpful friend sent me this link to a sample Microsoft exam for the MCWD (Microsoft Certified Web Developer) qualification, which I think would be a good one for me.

I didn’t have high hopes, even though only 75 percent is needed to pass, because frankly I’m still learning this asp.net thing and wouldn’t consider myself a guru by any means. Still, armed with precisely no research or revision, I bravely had a go. And I got 80 percent. That’s right, 24 out of 30 if my matchs is correct.

So, either the exam is easy (possible) or I am a genius (unlikely). It’s funny that the questions that tripped me up were the ones where I tried to pick the ‘clever’ answer, but it turned out to be the simpler answer that was correct. I’ll learn that for next time. Plus a couple of the questions on web accessibility were, to be honest, well behind the times.

Still, I was glad to see that the exam ranged from accessibility to SQL usage, via internationalisation, personalisation, Javascript and more. So it looks like I’ll be booking the real exam sometime soon. And, with any luck, I’ll have a proper qualification after all.

Event Delegation versus Event Handling…

I saw this useful tip earlier today. I know it sounds boring, but it’s actually a pretty good idea.

For a long while now I’ve been working on a thing called the ‘Performer Javascript library’ which works with Prototype to allow developers to attach Javascript code to repeating elements – such as a list of items fetched from a database – using unobtrusive and clean code. For people who write web apps this is a useful addition to have.

The link above gives another way to do this by capturingan event (for example a click) and watching the ‘bubbling’ of the event element to see what it should do in response. I’ll almost certainly be trying it out soon. However for the time being I’m working on finishing a little app written in PHP and Javascript which shows off the power of Prototype. I’ll put that here for your entertainment soon.

Content management – a fresh approach…

Further to my article on the power of the niche I read this interesting article by highly acclaimed uber-geek Eric Sink. In it he describes how, when writing a computer application at least, going for a small portion of a large market may not be the best idea.

He’s absolutely right. I have a tendency to “open my mind” far too often when forming ideas for an app.I start thinking about related features, additional uses for the app, plugins, new markets, additional functions. And before I know it, instead of the streamlined sportscar I originally started out with, I have a double-decker bus.

And that’s a problem. A huge problem. Because I can’t please all the people all of the time, not even close, so why should I bother. If I try to do too many things I’ll end up failing at all of them, but if I just do a handful of things really, really well then I have a good chance of getting it right.

So I’ve been thinking of the smallest market I could possibly go for, the narrowest niche I could develop a product for. And, of course, that market is me. just me. No-one else. I just need to do something that does what I need it to do, and ignore those voices in my head that shout about making “a viable business opportunity”. Instead I should just do something that fits my needs perfectly.

So, what am I going to make? Well, there’s just one thing that I really need at the moment, and that’s a decent piece of software for managing my websites more easily. While I could use one of the many content management systems already out there, the fact is I want to do things in a particular way.

For one thing I don’t want there to the any difference between a page and a folder. As I am fanatical about clean URLs this makes sense. Consider these examples:

mysite.com/my-page
mysite.com/my-page/more-info

Now some people would say that “my-page” is a folder, when that folder is accessed in a web browser an index page is shown. However I don’t agree, because it can be accessed directly and it has it’s own content. Therefore it’s just a page which happens to have a child (“more-info”). And “more-info” is just a page, whether it has any children or not.

Strange though it may seem for people used to using more traditional CMSs, it’s actually pretty easy to visualise if you think of it in database terms. Here’s my table with some sample data:

ItemID ParentID ItemName Content Permalink
1 1 Homepage Welcome to the homepage homepage
2 1 My Page Welcome to my page my-page
3 2 More Infomation Some more infomation more-info

So you can see I have three items in my database. The first item is the website homepage, cunningly called “homepage”. The next item is a child of the homepage – notice it has a ParentID of 1? That means the ID of the parent of that item is the item with the ID 1. If that sentence makes sense to you you’re doing very well. The next item has a ParentID of 2, because it is a child of the “My Page” item.

One thing to note is the Permalink colum. That stores a URL-safe version of the page name, and is the bit that will appear in the address bar of the browser when each page is loaded, for example “mysite.com/my-page/more-info”.

Using this system I can have as many pages as I want, all with a logical relationship to each other. I can easily set the content of each page, change the title (and the permalink if I want) but know that my menu system will always know where each page is and how to get to it. Fantastic.

However I want more. Much more. For example, I want to be able to create an image gallery anywhere I want in my website, with different sizes available for each image. I want to be able to create a wiki if I want, or a forum, or a blog. And that means I need to set the type of each item, like this:

ItemID ParentID ItemType ItemName Content Permalink
1 1 Page Homepage Welcome to the homepage homepage
2 1 Page My Page Welcome to my page my-page
3 2 Gallery My Pictures Here are some holiday snaps my-pictures
4 1 Blog Bloggity blog Welcome to my blog blog

So now I have the following site:

mysite.com/ (site homepage)
mysite.com/my-page (a normal page)
mysite.com/my-page/my-pictures (an image gallery)
mysite.com/blog (a blog)

You might be thinking why would I want to do that? Well, I just do. Remember this is for me, no-one else. It’s my app and I’ll code what I like :0)

So now my system knows what type each item is I can do all manner of things. In my administration system I can load the correct forms and functions – so where the item is a gallery it would allow me to upload images and create photosets, for instance, or for a blog it would allow me to create a new entry that would automatically be added to a date-specific archive. And on the public pages I could do what I want too, like load some JavaScript just for gallery pages that allows me to use a lightbox.

Obviously there’s a lot more floating round my head than just that. However if I get something that does exactly what I want it to, and works exactly how I want it to, then that would be great. The only problem is, if I’m developing this just for myself, who’s going to tell me when to stop?

Stastically speaking…

For the last few months I’ve been getting more and more interested in website statistics program. While one of my clients uses the excellent Mint it’s not the right answer for everyone. For instance, it doesn’t handle storing multiple sets of stats for diffeent domains in the same database therefore making it useless for the Wiblog system.

So, last January, I did what I usually do in these situations and ‘rolled my own’. So part of the new Wiblog system is a pretty tasty stats package that shows you not just the usual stuff (number of visitors by day, wekk, month, favourite pages, number of comments per month etc) but some other interesting stats such as popular search terms that brought people to your Wiblog, and even the ability to follow a particular users travels around your Wiblog.

But that’s not enough for me. Oh nosirree. I want to offer the power of usable statistics to my clients. So I’m developing a centralised statistics server that will gather data from all the websites I work on, and send regular reports.

The problem is that Javascript, which is the technology I use to do this cross-site stuff, has limits on how you can share data between different sites. While there are some solutions for these security limitations they aren’t quite ehat I’m looking for. So, again, I’m rolling my own. I’ll post the answer here when I’ve finalised it. In the meantime if anyone else has his the cross-site XMLHTTPRequest problem (you’ll know what it means if you’re geeky like me) then please add a comment with details of how you fixed it.