[uf-discuss] hcard telephone numbers

Ryan King ryan at technorati.com
Thu Jan 12 16:54:54 PST 2006


As I've been reviewing the 'examples in the wild' from http:// 
microformats.org/wiki/hcard, I've seen a *very* common error:

The latest of these [http://www.griffith.edu.au/cgi-bin/ 
phone_search.pl?format=search_detail&rec_num=3714]:

> <span class="tel"><span class="work">(07) 555 28286</span></span>

<span class="work">...</span> is wrong.

The above example should be:

<span class="tel"><span class="type">work</span> (07) 555 28286</span>

The type of telephone number is considered human-readable data and  
should not, therefore, be hidden.

Note, also that if you have more content (like some prose) in the tel  
property, you can make the value explicit with class="value". And you  
can use <abbr> if you want a different human-readable value. For  
example:

> <span class="tel">My <abbr class="type" title="cell">mobile</span>  
> phone number is <span class="value">+1 (415) 260 1398</span></span>

(it really is ;))

Remember that type is optional and here's the relevant part of the  
RFC, from section 3.3.1 of http://www.ietf.org/rfc/rfc2426.txt:

>    The type can include the type parameter "TYPE" to specify intended
>    use for the telephone number. The TYPE parameter values can  
> include:
>    "home" to indicate a telephone number associated with a residence,
>    "msg" to indicate the telephone number has voice messaging support,
>    "work" to indicate a telephone number associated with a place of
>    work, "pref" to indicate a preferred-use telephone number,  
> "voice" to
>    indicate a voice telephone number, "fax" to indicate a facsimile
>    telephone number, "cell" to indicate a cellular telephone number,
>    "video" to indicate a video conferencing telephone number,  
> "pager" to
>    indicate a paging device telephone number, "bbs" to indicate a
>    bulletin board system telephone number, "modem" to indicate a MODEM
>    connected telephone number, "car" to indicate a car-phone telephone
>    number, "isdn" to indicate an ISDN service telephone number,  
> "pcs" to
>    indicate a personal communication services telephone number. The
>    default type is "voice". These type parameter values can be  
> specified
>    as a parameter list (i.e., "TYPE=work;TYPE=voice") or as a value  
> list
>    (i.e., "TYPE=work,voice"). The default can be overridden to another
>    set of values by specifying one or more alternate values. For
>    example, the default TYPE of "voice" can be reset to a WORK and  
> HOME,
>    VOICE and FAX telephone number by the value list
>    "TYPE=work,home,voice,fax".

I'll buy a beer (or the beverage of your choosing) for the first  
person to legitimately publish an hcard with a BBS phone number*.

-rk

* must meet in person to collect :D
--
Ryan King
ryan at technorati.com





More information about the microformats-discuss mailing list