hCard cheatsheet

(Difference between revisions)

Jump to: navigation, search
m
Current revision (00:31, 1 August 2011) (view source)
(entry title)
 
(30 intermediate revisions not shown.)
Line 1: Line 1:
-
<h1>hCard cheetsheet</h1>
+
<entry-title>hCard cheatsheet</entry-title>
 +
 
 +
[[hcard|hCard]] properties and how to use them.
==Profile==
==Profile==
-
<nowiki><head profile="http://www.w3.org/2006/03/hcard"></nowiki>
+
Place the following into the <nowiki><head></nowiki> of your document:
 +
 
 +
<source lang=html4strict>
 +
<link rel="profile" href="http://microformats.org/profile/hcard">
 +
</source>
 +
See [[rel-profile]] for details.
==Properties  (Class Names)==
==Properties  (Class Names)==
Line 47: Line 54:
**[[hcard-singular-properties#sort-string|sort-string]]?
**[[hcard-singular-properties#sort-string|sort-string]]?
**''sound''*
**''sound''*
-
**''title''*
 
**''tel''* ''(Note [http://en.wikipedia.org/wiki/E.123 E.123] for formatting info.)''
**''tel''* ''(Note [http://en.wikipedia.org/wiki/E.123 E.123] for formatting info.)''
***type [home|work|pref|fax|cell|pager]?
***type [home|work|pref|fax|cell|pager]?
***value?
***value?
 +
**''title''*
**[[hcard-singular-properties#tz|tz]]? ''timezone of the person''
**[[hcard-singular-properties#tz|tz]]? ''timezone of the person''
**[[hcard-singular-properties#uid|uid]]?  ''applies to the ''entire'' hCard''
**[[hcard-singular-properties#uid|uid]]?  ''applies to the ''entire'' hCard''
Line 67: Line 74:
===Notes===
===Notes===
-
* <code>URL</code> in vCard becomes  <code><a url href=...>...</a></code> inside the element with <code>vcard</code> in hCard.
+
*{{rfc-2119-intro}}
-
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a email href=mailto:...>...</a></nowiki></code>
+
* <code>URL</code> in vCard becomes  <code><a class="url" href=...>...</a></code> inside the element with class <code>vcard</code> in hCard.
-
* <code>PHOTO</code> in vCard becomes <code><img photo src=... alt=Photo of ... /></code> or <code><object photo data=... type=...>Photo of ...</object></code>
+
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a class="email" href="mailto:...">...</a></nowiki></code>
 +
* <code>FN</code> is an abbreviation of "'''formatted name'''".
 +
* <code>PHOTO</code> in vCard becomes <code><img class="photo" src=... alt="Photo of ..." /></code> or <code><object class="photo" data=... type=...>Photo of ...</object></code>
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
* <code>UID</code> in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.
-
*If an adr-child (e.g ''street-address'') is present it will ONLY be considered part of the hCard data IF it is inside an ''adr''.
+
* Compare <code>TITLE</code> of "Wing Commander" with <code>ROLE</code> of "pilot".
 +
 
 +
====Adr====
 +
{{adr-note}}
====Geo====
====Geo====
-
*If latitude is present, so MUST be longitude, and vice versa.
+
{{geo-note}}
-
*If the secondary classes are omitted, the two values MUST be comma separated and latitude MUST be first:<code><nowiki><span class=geo>37.386013,-122.082932</span></nowiki></code>
+
 
-
*The same number of decimal places SHOULD be used in each value.
+
==Deprecated==
 +
=== profile attribute===
 +
Previously this cheatsheet advised adding a profile attribute to the <nowiki><head></nowiki> like this:
 +
<source lang=html4strict>
 +
<head profile="http://www.w3.org/2006/03/hcard" />
 +
</source>
 +
 
 +
This technique is valid for HTML4.x and XHTML1.x, however [http://stackoverflow.com/questions/1585220/use-of-profile-attribute-in-html-head-tag this is invalid for HTML5], thus authors are advised to use <nowiki><link rel=profile ...></nowiki> instead as [[#Profile|described above]] See [[hcard#Profile| hCard:Profile]] for more information.
==Related pages==
==Related pages==
{{hcard-related-pages}}
{{hcard-related-pages}}
 +
*[[rel-profile]]
*{{cheatsheets}}
*{{cheatsheets}}

Current revision


hCard properties and how to use them.

Contents

Profile

Place the following into the <head> of your document:

<link rel="profile" href="http://microformats.org/profile/hcard">

See rel-profile for details.

Properties (Class Names)

Key

Based on Perl's standard quantifiers:

bold {1} MUST be present exactly once
italic* OPTIONAL, and MAY occur more than once
+ MUST be present, and MAY occur more than once
 ? OPTIONAL, but MUST NOT occur more than once
[square brackets] list of common values
(parentheses) data format
# comment
 ! awaiting documentation
pref preferred
dom domestic
intl international
cell mobile

Notes

Adr

Geo

<abbr class="geo" title="37.386013;-122.082932">home</abbr>

Deprecated

profile attribute

Previously this cheatsheet advised adding a profile attribute to the <head> like this:

<head profile="http://www.w3.org/2006/03/hcard" />

This technique is valid for HTML4.x and XHTML1.x, however this is invalid for HTML5, thus authors are advised to use <link rel=profile ...> instead as described above See hCard:Profile for more information.

Related pages

The hCard specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. These thoughts, issues, and questions are kept in separate pages.

hCard cheatsheet was last modified: Monday, August 1st, 2011

Views