Bruce Lawson’s personal site

Silly microformats question

I’ve been a bit wary of microformats, as I believe they play fast and loose with the semantics of the abbr element. They do this simply to accommodate Safari’s broken support for object, and thereby force a screenreader user who listens to titles to sit though monstrous reams of numbers or other data, that’s meant for machines not people.

But, I’ll try anything once (except necrophilia and Morris dancing), so decided to make a punter’s Contact Us page into an hCard.

And discovered it’s just too damn difficult for my wee brain to deal with. Here’s the deal: I need to mark up the following contact phone numbers (and it seems to me that helpline opening hours are part of contact details, phone prices arguably so):

Helpline – 0845 123 1234, Open Monday to Friday, 8am to 6pm, Calls to our helpline cost no more than 5p per minute for BT customers; other networks may vary.
Tel: 01926 123456
International: +44 (0)1926 123456
Fax: 01926 89123
Minicom: 0845 123 4567

Nothing in the type subproperty values list gives me any clue. Do you know, gentle reader?

16 Responses to “ Silly microformats question ”

Comment by trovster

I do not believe that you can (currently) add the opening hours and prices to the phone information. This is becuase hCards are based upon the vCards specification and it’s not in there (I think). Open up your contacts in Outlook or Address Book (or whatever you use). The fields in there, are the kind of fields you can use in a hCard, although I don’t think every input has been migrated in to the HTML ‘spec’

Helpline – [span class=”tel”]0845 123 1234[/span], Open Monday to Friday, 8am to 6pm, Calls to our helpline cost no more than 5p per minute for BT customers; other networks may vary.
Tel: [span class=”tel”]01926 123456[/span]
[span class=”tel”][abbr class=”type” title=”intl”]International[/abbr]: [span class=”value”]+44 (0)1926 123456[/span][/span]
[span class=”tel”][abbr class=”type” title=”fax”]Fax[/abbr]: [span class=”value”]01926 89123[/span][/span]
Minicom: [span class=”tel”]0845 123 4567[/span]

wow, a lot of spans (problem with marking up phone numbers IMO). And I THINK that’s correct. Although, the international value is from the ‘adr’ type property, and there doesn’t seem to be one for the telephone.

Comment by Andy Higgs

Like Trev said, but I would be inclined to markup the word ‘international’ with a SPAN rather than ABBR whether it is a correct hCard ‘attribute’ or not.

[span type=”tel” title=”intl”]international[/span]

Comment by Bruce

Thanks lads. So my worry about using abbr is compounded. I can’t see that “voicemail” is an abbreviation of “msg”, even though I wilfully misuse abbr when I should be using acronym or even the never-in-the-spec “initialism” tag.

Think I’ll just forget about the hCard …

Comment by Mo

(I’ve nothing helpful to say, particularly, but this struck me):

Using the title attribute like that seems so fundamentally opposed to the principles of semantic mark-up, and by extension precisely the opposite of what microformats are supposed to accomplish.

What on earth happened to making use of XHTML and sticking additional attributes in a separate namespace? This bastardisation of attributes in the (wrongful) name of ‘semantics’ seems to be a case of cutting off the nose to spite the face.

Comment by trovster

Instead of just forgetting about the hCard completely, why not just mark up the two telephone numbers, the helpline and the normal telephone number…

Helpline – [span class=”tel”]0845 123 1234[/span], Open Monday to Friday, 8am to 6pm, Calls to our helpline cost no more than 5p per minute for BT customers; other networks may vary.
Tel: [span class=”tel”]01926 123456[/span]

That means you get the extra information, without overdoing on the use of span (or any other inline element you want to use) and you wouldn’t feel bad in abusing the abbr element.

Is using abbr when you want an acronym ‘wilfully misuing’ it? It’s not as complete as it can be, but it’s not incorrect. Because every acronym is an abbreviation. In fact it’s a hundred times better than people using acronym all the time, because IE refuses to acknowledge abbr!

Comment by Bruce

Well, I agree, Mo (at the risk of being accused of being Chicken Little).

Trovster – it’s not wilful misuse, no; my rationale is the same as yours – better the closest usable semantic choice than none. Nice compromise your suggest, too. Thanks!

Comment by Andy Mabbett

Wrapping some or all of “Helpline – 0845 123 1234, Open Monday to Friday, 8am to 6pm, Calls to our helpline cost no more than 5p per minute for BT customers; other networks may vary.” in a span (or whatever) with class=”note” will include it in the hCard as a free-text note field.

Comment by Andy Mabbett

P.P.S. The International standard for telephone number display specifies that your “+44 (0)1926 123456” should be “+44 1926 123456”.

Omit the markup on one of the phone numbers and mark up the other as, say:

<abbr title=”+44 1926 123456″>01926 123456</abbr>

(Your valid concerns about abbr/msg/voicemail not withstanding, of course.)

Two prizes?

Regards,

Comment by Ben Ward

As well as Andy’s use of ABBR to include the international format telephone number over the human-readible UK format, you could also do this:

[span class=”tel”][span class=”value”]+44[/span] (0) [span class=”value”]1926 123456[/span][/span]

Those two ‘value’ spans will then be appended together to make a valid international format number, without the human-readable ‘(0)’ breaking it.

And of course, you don’t have to use SPANs and DIVs, if there’s a more appropriate structural element available.

Comment by Bruce

cheers Ben. Looks like that would work fine. There’s a highly-practical article on the accessiblity of microformats coming next week. (Or, most likely next month, given my legendary slackness.)

Leave a Reply

HTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> . To display code, manually escape it.