Out and about (17:19 pm)…

Hurrah for breakthroughs! Today's? Creating Ms Word documents with embedded images using VBScript and a browser. All thanks to the wonder that is MHTML.

Content follows form – or does it?…

Over at OK/Cancel (a very fine comic, by the way) they say that content should follow form, as there’s no use showing a very long piece of text on a mobile phone. I agree – to a certain extent.

I’m not sure that the writer (the estimable Tom Chi) has a full grip on what web standards (CSS

In practice, the CSS step is helpful for dealing with maintenance of web layouts/styles, but truly valuable separation happens in a different place – it happens simply in deciding to store/serve your data using a database instead of hand-coding static content.

But this isn’t the only way to do it. Consider a long piece of text. I’ve shortened it into 4 “paragraphs”. You’ll have to imagine lots more text in each paragraph.

Paragraph 1

Paragraph 2

Paragraph 3

Paragraph 4

So, on a screen (computer monitor, TV, projector screen etc) this would be fine. But on a mobile phone or other small output device, it would be too much to read. In comes CSS, like the Lone Ranger, to sort out all our problems. Add a class to each paragraph:

Paragraph 1

Paragraph 2

Paragraph 3

Paragraph 4

Then you can use CSS to select which paragraphs to send to each device, like this:

@media screen
{
p.par1, p.par2, p.par3, p.par4
{
display: block;
}
}
@media handheld
{
p.par1
{
display: block;
}
p.par2, p.par3, p.par4
{
display: none;
}
}

More information on media types can be found here. There, problem sorted.

You could go a lot further and use the very powerful child selectors (due to get even better in CSS3) to automatically select the first X number of paragraphs for display to different media. An, of course, a smattering of DOM manipulation could add a link to the full-length article for devices that don’t get all the text by default.

So, while content can follow form, with CSS it doesn’t have to.

User-defined data structures…

Yes, it sounds boring, but it isn’t. As one Matthew Cahill says in his intelligent article on tagging, they are neato. And I believe him, not just because he Gets It, but because he has a gorgeous-looking site, and is respected enough to have recently been made a member of the 9rules network.

I can’t really add anything to what Matt Cahill said, although I will stress that one of the most powerful advantages of this tagging malarkey is that users don’t even have to know they are doing it. For example, I could make the Wiblog system make every word in this post a tag so people could search by it, and output some pretty reports and statistics about how many times each word has been used. I won’t, because this is far too much text with far too many non-essential tag words in it (“too”, “in”, “it” etc). But how about auto-tagging the subject? Easy-peasy.

So, tagging is not only putting the power back in the users hands, it doesn’t even have to be a chore for them. Fantastic.

Guide to the UK…

Dave is at it again, with his Guide to the UK. My suggestions for the list of lists? Well…

1) Music instrument shops with friendliest staff who let you play with expensive instruments for hours without even the smallest chance you’ll buy them
2) Best hot chocolate purveyers
3) Most picturesque arcade (in the Victorian, rather than the modern entertainment) sense of the word
4) Best walks with a decent pub at the end

I have suggestions for all of these, Dave, if you’re interested.

A new year, with no beer…

Yes, it’s true. I’m giving up beer. Not that I drink lots of it (although a quart or two were quaffed over the festive season), but it’s a necessary sacrifice to make in order to lose a bit of weight. Yes, that New Year Weight Guilt thing has affected me too. I considered giving up chocolate as well, but … one step at a time, eh?

Anyway, before I get too deep into work I thought I’d pen a line to welcome in the new year in true geek fashion. So head on over to Kurafire.net, Faruk’s site, where his FACE thingy will have you jumping with delight. It’s along similar lines to my Refresher function (part of the soon-to-be-announced Performer family, watch this space), but much cleverer.