HTML5 Microdata: Use It Today
Join the DZone community and get the full member experience.Join For Free
the way i see it, there are three main problems with the current microdata spec. first of all the syntax is just too verbose. you need at least three new properties (itemscope, itemtype and itemprop) to get anything useful out of your marked-up elements, two of them requiring custom attribute values (itemtype and itemprop). that's a lot of extra data for something microformats fixed with just a few (extra) classes.
the second thing that worries me is the obvious correlation between microdata and class names. i know they are two different things with different goals and purposes, but there's an undeniable link between the two of them. different semantic elements require different styling (if not now, then maybe in the future so if you're into future-proof coding this is a fact rather than a possibility). when using microdata you're pretty much doing the same work twice: naming elements with semantics in mind and naming elements with styling in mind. not very efficient if you ask me.
and finally, getting your hard work implemented will prove to be an additional challenge. it's hard enough to get the cms to throw up the classes and tags you requested, if you're going to bother back-end developers with a stack of semantic hocus pocus things might end up a true battlefield. while this sounds like the least important issue we're dealing with (as it is not ideological in nature), it's actually the one that has the biggest impact on the success rate of the whole operation.
here and now
so why bother with microdata? well, because google bothers. if you implement known microdata vocabulary in your site today google can and will pick it up (to test it, you can use the google's rich snippets testing tool . while this data is currently not used for page ranking purposes, it can be used to enhance your search result snippets (i think the most visible example today is when google ads review ratings to the search results).
if you want known vocabularies (which is way more interesting than inventing your own and ending up with microdata definitions no machine can read) you can check sites like schema.org which give you a proper overview of the most common vocabularies out there. it takes some time to get used to the site and to find what you're looking for (some extra examples would've come in handy) but once you get a feel for it (and you see some results in the google testing tool) i assure you things will go smoothly from there on.
<article itemscope="itemscope" itemtype="http://schema.org/person"> <h1 itemprop="name">(person name)</h1> </article>the example above illustrates the most basic use of microdata. each base tag of an object is marked with the itemscope attribute (i'm using the xml serialization syntax here), the nature of the object is given through the itemtype property (which is a working url to the page containing the vocabulary syntax). the attributes of the object are defined through the itemprop property which can be set on all nested elements.
the entire microdata syntax is a bit more versatile, allowing you to add not-nested data to an object, uniquely identify objects and to define multiple properties for one single value, but i'll just direct you to the w3 microdata page as they explain it in much more detail than i ever could.
safe its over-verbose syntax and repetitive nature, html5 microdata is cool because it works today. add it to your pages and watch how google picks it up, using it to enrich its search results. hopefully it will at one time influence page ranking (as google can now properly interpret your data), but i assume that for the time being they're not allowing it in an attempt to counter blackhat seo tactics (in other words, microdata abuse to increase page ranking).
so if you feel any affinity with semantics, now is the time to get really started. check the microdata syntax, bookmark the vocabularies and you're good to go. exciting times indeed!
Opinions expressed by DZone contributors are their own.