Difference between revisions of "h-adr"

From Microformats Wiki
Jump to navigation Jump to search
m (corrected intro)
(dumped h-item spec)
Line 1: Line 1:
<entry-title>h-adr</entry-title>
+
<entry-title>h-item</entry-title>
 
<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
 
<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
 
----
 
----
<dfn style="font-style:normal;font-weight:bold">h-adr</dfn> is a simple, open format for publishing postal address information on the web. h-adr is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML/HTML5.
+
<dfn style="font-style:normal;font-weight:bold">h-item</dfn> is a simple, open format for publishing details about arbitrary items on the web. h-item is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML/HTML5.
  
h-adr is the [[microformats-2]] replacement for [[adr]]. It is most commonly used as part of an [[h-card]] or [[h-event]].
+
In practise, h-item is almost never used on it’s own, but rather as the '''p-item''' in a [[h-review]] as a generic fallback if the item being reviewed cannot be accurately represented by either an [[h-card]], [[h-product]], [[h-event]], [[h-adr]] or [[h-geo]].
  
 
== Example ==
 
== Example ==
Here is a simple minimal person example:
+
 
 +
As the only properties defined by h-item are '''p-name''', '''u-url''' and '''u-photo''', in practise only the root classname is ever actually required (thanks to [[microformats-2-implied-properties]]) unless perhaps you have some unusual markup structure.
  
 
<source lang=html4strict>
 
<source lang=html4strict>
<p class="p-adr h-adr">
+
<a class="h-item" href="http://example.org/items/1">
  <span class="p-street-address">17 Austerstræti</span>
+
   <img src="http://example.org/items/1/photo.png" alt="" />
   <span class="p-locality">Reykjavík</span>
+
   The Item Name
  <span class="p-country-name">Iceland</span>
+
</a>
   <span class="p-postal-code">107</span>
 
</p>
 
 
</source>
 
</source>
 
=== Get started ===
 
The class '''<code>h-adr</code>''' is a ''root class name'' that indicates the presence of an h-adr.
 
 
'''p-street-address''', '''p-extended-address''' and all the other h-adr property classnames define an element as a ''property'' of the h-adr.
 
 
See [[microformats-2-parsing]] to learn more about property classnames.
 
  
 
== Properties ==
 
== Properties ==
  
* '''<code>p-street-address</code>''' - house/apartment number, floor, street name
+
* '''<code>p-name</code>''' - item name
* '''<code>p-extended-address</code>''' - additional street details
+
* '''<code>u-url</code>''' - permalink URL
* '''<code>p-post-office-box</code>'''
+
* '''<code>u-photo</code>''' - photo URL
* '''<code>p-locality</code>''' - city/town/village
 
* '''<code>p-region</code>''' - state/county/province
 
* '''<code>p-postal-code</code>''' - postal code, e.g. ZIP in the US
 
* '''<code>p-country-name</code>''' - country name
 
* '''<code>p-label</code>''' - new in vCard4 (RFC6350)
 
* '''<code>p-geo</code>''' (or u-geo with a RFC 5870 geo: URL), optionally a nested [[h-geo]]
 
* '''<code>p-latitude</code>''' - metric latitude
 
* '''<code>p-longitude</code>''' - metric longitude
 
* '''<code>p-altitude</code>''' - metric altitude
 
 
 
For backward compatibility, you may wish to use classic [[adr]] classnames in addition to the more future-proof h-adr properties, for example:
 
 
 
<source lang=html4strict>
 
<span class="p-street-address street-address">123 Main St.</span>
 
</source>
 
 
 
Microformats parsers should detect classic properties and parse them as microformats 2 properties. If an "h-adr" is found, don't look for an "adr" on the same element.
 
 
 
Compatibility root class name: adr
 
 
 
Properties: (parsed as p- plain text unless otherwise specified)
 
 
 
* post-office-box
 
* extended-address
 
* street-address
 
* locality
 
* region
 
* postal-code
 
* country-name
 
  
 
== Status ==
 
== Status ==
  
'''h-adr''' is a microformats.org draft specification. Public discussion on h-adr takes place on [[h-adr-feedback]], the #microformats [[irc]] channel on irc.freenode.net, and [http://microformats.org/discuss/mail/microformats-new/ microformats-new mailing list].
+
'''h-item''' is a microformats.org draft specification. Public discussion on h-item takes place on [[h-item-feedback]], the #microformats [[irc]] channel on irc.freenode.net, and [http://microformats.org/discuss/mail/microformats-new/ microformats-new mailing list].
 
 
h-adr is ready to use and implemented in the wild, but for backwards compatibility you should also mark h-adrs up with classic [[adr]] classnames.
 
  
 
== Property Details ==
 
== Property Details ==
Line 72: Line 33:
 
== Examples in the Wild ==
 
== Examples in the Wild ==
  
* … add any h-adr examples you find in the wild
+
* … add any h-item examples you find in the wild
  
 
== Background ==
 
== Background ==
  
h-adr is based on the existing [[adr]] specification, which was extracted from [[hCard]] in order to allow it to be used for applications other than contact information.
+
h-item was extracted from the classic [[hReview]] microformat as a way of referring to arbitrary reviewed items which cannot be represented by other microformats but which required a “shell” microformat due to the flat property requirement of microformats 2.
  
 
== See Also ==
 
== See Also ==
  
 
* [[microformats-2]]
 
* [[microformats-2]]
* [[h-geo]] can be nested in h-adr
+
* [[h-review]]
* [[h-card]] and [[h-event]] often contain h-adr
 

Revision as of 23:13, 13 June 2013

<entry-title>h-item</entry-title> Tantek Çelik (Editor)


h-item is a simple, open format for publishing details about arbitrary items on the web. h-item is one of several open microformat draft standards suitable for embedding data in HTML/HTML5.

In practise, h-item is almost never used on it’s own, but rather as the p-item in a h-review as a generic fallback if the item being reviewed cannot be accurately represented by either an h-card, h-product, h-event, h-adr or h-geo.

Example

As the only properties defined by h-item are p-name, u-url and u-photo, in practise only the root classname is ever actually required (thanks to microformats2 implied properties) unless perhaps you have some unusual markup structure.

<a class="h-item" href="http://example.org/items/1">
  <img src="http://example.org/items/1/photo.png" alt="" />
  The Item Name
</a>

Properties

  • p-name - item name
  • u-url - permalink URL
  • u-photo - photo URL

Status

h-item is a microformats.org draft specification. Public discussion on h-item takes place on h-item-feedback, the #microformats #microformats chat channel on irc.freenode.net, and microformats-new mailing list.

Property Details

(stub, add any property explanations here)

Examples in the Wild

  • … add any h-item examples you find in the wild

Background

h-item was extracted from the classic hReview 0.4 (in progress) microformat as a way of referring to arbitrary reviewed items which cannot be represented by other microformats but which required a “shell” microformat due to the flat property requirement of microformats 2.

See Also