[uf-discuss] hCard - Telephone types (cell, office etc)

Frances Berriman fberriman at gmail.com
Tue Nov 14 09:16:56 PST 2006


On 11/14/06, Ian Lloyd <lists at lloydi.com> wrote:
> I have used a Microformat for the first time in a project (cue
> fanfare) but it's not working out 100% as I had hoped (cue loud
> booing noise and general rasping).

Yay :D (the first part, anyway, although the fun is in the latter)


> I want the telephone numbers to display on screen as Work and Mobile,
> but understand that it needs to be marked up as Office and Cell. So I
> want to use CSS to hide the proper terminology and display the UK-
> centric terms instead.
>
> Is this OK?

I'd probably do the same.  Hiding info for that sort of purpose
doesn't seem so awful. There's nothing technically wrong with doing
it.

>   <div>Office: <span class="tel"><span class="type">Work</span> <span
> class="value">+44 (0) 121 683 5151</span></span></div>
>   <div>Mobile: <span class="tel"><span class="type">Cell</span> <span
> class="value">+44 (0) 7710 623044</span></span></div>


Someone showed me markup like this a couple weeks ago and he was
having trouble marking stuff up with tel used twice, since the parsers
were only grabbing the last instance of tel (over-writing any found
before).  Instead, use:

<div class="tel">
Office: <span class="type">Work</span> <span class="value">+44 (0) 121
683 5151</span>
Office: <span class="type">Cell</span> <span class="value">+44 (0)
7710 623044</span>
</div>

One section of telephone contacts, with lots of types and values
within that block (I left the out the extra divs - I'd probably put
them in a list (class="tel" on the ul and so on with the list items
being the office number and the cell phone number)!) . :)

Hope that helps.


-- 
Frances Berriman
http://fberriman.com


More information about the microformats-discuss mailing list