Creative Web Specialist - An online portfolio and resource site of Warren Buckley

Latest Posts

Feb05th

hCards in Umbraco

Author
Warren Buckley
Categories

Hello again and this post I plan to cover the topic of using hCards in the opensource CMS Umbraco.

hCards is a relatively new idea of marking up contact information in a set standardised way. In doing so this allows you to automatically create address book entires from hCard information for your address book software. hCards is one of many microformats that are appearing on the web. I won’t go into depth into hCards as there are many resources on the web for this, but for an overview on hCards and microformats I recommend the following links.

I have created a solution using a macro that allows you to easily create a hCard microformat within the Rich Text Editor of Umbraco.

To set this up we need to create a new blank XSLT file with a matching macro.

Next create the following paramters on your newly created macro.

XSLT hCard Generator Macro Properties

Finally with the macro you need to ensure that Use in Editor and Render Content in Editor are ticked on the Macro Properties tab.

Finally download my XSLT in the zip file and copy the XSLT contents into the blank XSLT within Umbraco.

The XSLT is very simple here, it simply grabs the parameters from the macro and sets them in variables which we can then use to build our hCard. The only technical part is adding the hCard to vCard conversion link which converts the html hCard into address book contact which is also known as a vCard.

Technorati and Suda.co.uk both offer this hCard to vCard service for free, but I have chosen Technorati as they have more bandwidth and are likely to have a greater uptime than a personal website. These services basically scan a specific URL and check for any hCards and then convert them into a vCard.

For the Technorati service they need the link set up as follows,
http://feeds.technorati.com/contacts/http://www.mywebsite.co.uk/myhCardpage.aspx

I plan to update this XSLT, so that it can allow macro paramters to be emtpy and then not display that part within the hCard, but at the moment this involves many XSL:Choose’s, that I am getting lost and confused on where to put them. If anyone can give me any advice on how best to tackle this it would be most appreciated

As always I appreciate any feedback.

Warren

1 comment
14th May, 2008
Very nice introduction of microformats and how to implement in umbraco.
Post a comment »

Comment's have been disabled, due to getting hit badly with comment form spam

My Skill Set

This is a quick list of my skill set to date

  • XHTML
  • CSS
  • Photoshop (Slicing)
  • XSLT
  • ASP.NET
  • Umbraco .NET CMS

My del.icio.us

My Last.FM

I am listening to:

  • Ain't Pretending by CowbellOh Girl29 Jul 2010, 10:37
  • Just Want Your Love by CowbellOh Girl29 Jul 2010, 10:33
  • Oh Girl by CowbellOh Girl29 Jul 2010, 10:31
Warren Buckley is an umbraco MVP 2008/2009 Warren Buckley is an umbraco level 1 certified developer

Photo of Warren Buckley Warren Buckley is a Creative Web Specialist based in Leigh on Sea, Essex , UK.