Microformats, Making your Content a Little More Useful

Published: 2007-07-29

Microformating is a tidy new way to markup your XHTML content making it more useful for consumption by machines.  The markup is designed to sit on top of your existing XHTML so there is no visual difference, as defined on microformats.org, they are ‘Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards’.

Practical example - hcard

Take the following code, a fairly standard method of marking up a contact name with a link to their website.

<ul>
<li>
<a href="http://www.coffeerings.co.uk">
John Walker
</a>
</li>
</ul> 

Using microformatting we can extend the markeup to provide much more meaning without changing the original output. The following addition of the 'class' attribute will alert any microformat reader that the hCard belonds to the 'John Walker' and that their website is 'http://www.coffeerings.co.uk'.

<ul>
<li>
<a href="http://www.coffeerings.co.uk"
class="url fn">
John Walker
</a>
</li>
</ul> 
  • 'url' relates to the 'a' tags 'href' attribute.
  • 'fn' relates to the value of the 'a' tag.

More Information

http://microformats.org/
http://microformats.org/wiki/hcard-cheatsheet

More from this section

RECENT ARTICLES

Lightweight blog created on Ruby/GAA/Datastore stack

Put this together a month or two back but never got around to replaci... read more

Using Node JS and Couch DB Stack for Web Dev

With the recent hype surrounding Node.js I thought I'd better get my ... read more

Campaign Monitor API Using PHP and SOAP

Campaign Monitor has a fairly comprehensive API and support docs.&nbs... read more

Google Maps Snippet

Absolute bare basics when it comes the Google Map api but a snippet o... read more

CREDITS

powered by php-wax the php framework