h-item: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(dumped h-item spec, was in h-adr by accident)
 
m (s/<source>/<syntaxhighlight>/)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<entry-title>h-item</entry-title>
<dfn style="font-style:normal;font-weight:bold">h-item</dfn> is a simple, open format for publishing details about arbitrary items. h-item is one of several open [[microformats|microformat]] draft standards suitable for embedding data in HTML.
<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-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.


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]].
In practice, h-item is almost never used on its own, but rather as the '''p-item''' in an [[h-review]] if the item being reviewed cannot otherwise be represented by either an [[h-card]], [[h-product]], [[h-event]], or other specific microformat.
 
;<span id="Status">Status</span>
:This is a '''Draft Specification'''
;Participate
:[[IRC]]: [irc://irc.libera.chat/microformats #microformats on Libera]
;Editor
:<span class="h-card vcard"><span class="p-name fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="p-role role">Editor</span>)</span>
;License
:{{cc0-owfa-license}}
__TOC__


== Example ==
== Example ==
As the only properties defined by h-item are '''p-name''', '''u-url''' and '''u-photo''', in practice only the root class name is ever actually required thanks to [[microformats-2-implied-properties]]. Explicit properties may be needed for unusual markup structures or to represent multiple values, e.g. multiple URLs, photos. etc..


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.
<syntaxhighlight lang="html">
 
<source lang=html4strict>
<a class="h-item" href="http://example.org/items/1">
<a class="h-item" href="http://example.org/items/1">
   <img src="http://example.org/items/1/photo.png" alt="" />
   <img src="http://example.org/items/1/photo.png" alt="" />
   The Item Name
   The Item Name
</a>
</a>
</source>
</syntaxhighlight>
 
Parsed JSON:
<syntaxhighlight lang="json">
{
  "items": [
    {
      "type": [
        "h-item"
      ],
      "properties": {
        "name": [
          "The Item Name"
        ],
        "photo": [
          "http://example.org/items/1/photo.png"
        ],
        "url": [
          "http://example.org/items/1"
        ]
      }
    }
  ]
}
</syntaxhighlight>


== Properties ==
== Properties ==
* '''<code>p-name</code>''' - item name
* '''<code>p-name</code>''' - item name
* '''<code>u-url</code>''' - permalink URL
* '''<code>u-url</code>''' - permalink URL
* '''<code>u-photo</code>''' - photo URL
* '''<code>u-photo</code>''' - photo URL
All properties are optional.


== Status ==
== Status ==


'''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-item''' is a microformats.org draft specification. Public discussion on h-item takes place on [[h-item-feedback]] and the #microformats [[irc]] channel on irc.freenode.net.


== Property Details ==
== Property Details ==
Line 32: Line 63:


== Examples in the Wild ==
== Examples in the Wild ==
* … add any h-item examples you find in the wild


* … add any h-item examples you find in the wild
== Validating ==
{{h-spec-section-validating}}


== Background ==
== Background ==
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.
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 ==
* [[microformats2]]
* [[h-review]]


* [[microformats-2]]
[[Category:Draft Specifications]]
* [[h-review]]

Latest revision as of 21:22, 26 July 2023

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

In practice, h-item is almost never used on its own, but rather as the p-item in an h-review if the item being reviewed cannot otherwise be represented by either an h-card, h-product, h-event, or other specific microformat.

Status
This is a Draft Specification
Participate
IRC: #microformats on Libera
Editor
Tantek Çelik (Editor)
License
Per CC0, to the extent possible under law, the editors have waived all copyright and related or neighboring rights to this work. In addition, as of 2024-11-25, the editors have made this specification available under the Open Web Foundation Agreement Version 1.0.

Example

As the only properties defined by h-item are p-name, u-url and u-photo, in practice only the root class name is ever actually required thanks to microformats-2-implied-properties. Explicit properties may be needed for unusual markup structures or to represent multiple values, e.g. multiple URLs, photos. etc..

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

Parsed JSON:

{
  "items": [
    {
      "type": [
        "h-item"
      ],
      "properties": {
        "name": [
          "The Item Name"
        ],
        "photo": [
          "http://example.org/items/1/photo.png"
        ],
        "url": [
          "http://example.org/items/1"
        ]
      }
    }
  ]
}

Properties

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

All properties are optional.

Status

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

Property Details

(stub, add any property explanations here)

Examples in the Wild

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

Validating

Main article: validators

Test and validate microformats2 markup in general with:

Background

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