Yet more fun with hCard microformats

Another few tricks with hcards.

These guys’ details are freely available on the web, so I hope they’ll forgive me for using them as examples.

Example 1

Paul Rodgers, Editor, 6 Music
Phone: (020) 7765 4763
Email: paul.rodgers@bbc.co.uk

When someone’s email address contains their organisation’s full name, it’d be churlish to refuse the opportunity, and no little thing like lower-case letters is getting in my way.

A couple of points to note in our first example:

  • Paul’s job title also includes the department he works for (well, controls, actually). That’s fab, since it lets us kill two cats with one ballbearing.
  • You’ll also notice a big org span, which has to encompass his department (organization-unit) and company name (organization-name) and a bunch of other stuff.
    • I’m hoping this is ok semantically. As I understand it, when both unit and name are specified, anything else should be ignored; and indeed, exporting to Notepad through Operator shows that it seems to have been interpreted correctly.
<p class="vcard">
  <span class="org"><span class="fn n"><span class="given-name">Paul</span> <span class="family-name">Rodgers</span></span>, <span class="title role">Editor, <span class="organization-unit">6 Music</span></span><br />

  Phone: <span class="tel">(020) 7765 4763</span><br />

  Email: <a href="mailto:paul.rodgers@bbc.co.uk" class="email">paul.rodgers@<span class="organization-name" style="text-transform:lowercase">BBC</span>.co.uk</a></span></p>

Which creates:

Paul Rodgers, Editor, 6 Music
Phone: (020) 7765 4763
Email:

Example 2

Second example:

Robert Gallacher, Editor, Planning & Station Sound
Phone: (020) 7765 4373
Email: robert.gallacher@bbc.co.uk

And Robert’s department isn’t stated here, so we’ll just mark it up as a role, which is easier. The org span can now go just around the letters BBC:

<p class="vcard">
  <span class="fn n"><span class="given-name">Robert</span> <span class="family-name">Gallacher</span></span>, <span class="title role">Editor, Planning & Station Sound</span><br />

  Phone: <span class="tel">(020) 7765 4373</span><br />

  Email: <a href="mailto:robert.gallacher@bbc.co.uk" class="email">robert.gallacher@<span class="org" style="text-transform:lowercase">BBC</span>.co.uk</a></p>

Which creates:

Robert Gallacher, Editor, Planning & Station Sound
Phone: (020) 7765 4373
Email:

Please note the date on this entry. It could well be that these people’s details are no longer accurate. View them as examples only.

About Herm

Worlds Built Cheap
This entry was posted in coding, microformats, web, work. Bookmark the permalink.