Monday, February 4

XFN and Blogger Templates

Inspired by Google’s new Social Graph API (yay, bradfitz!), I’ve added XFN annotations to my blog template for the “Elsewhere” and “Friend’s Blogs” link lists, as well as my Blogger profile link.

This is pretty easy to do in Blogger. Just edit your template’s HTML and click the “Expand Widget Templates” checkbox. Then, look for the templates for the link lists you want:
<b:widget id='LinkList2' locked='false'
title='Friends’ Blogs' type='LinkList'>
<b:includable id='main'>
<b:if cond='data:title'><h2><data:title/></h2></b:if>
<div class='widget-content'>
<ul>
<b:loop values='data:links' var='link'>
<li><a expr:href='data:link.target'><data:link.name/></a></li>
</b:loop>
</ul>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
Then, inside that <a> tag, just add: rel="friend" or rel="me".

You can use the Social Graph API’s Site Connectivity demo to check the output, though it’ll take a bit of time (I’m not sure how long) until the data is crawled.

2 comments:

template-godown said...

why XFN is so important?

and i'm interested with your sidebar widget which is offering feed subscribe.

may i have one? if so, than, awaiting for the code. thank you in advance.

Pete said...

XFN: It's interesting to programmatically link web pages together with meaningful information. Imagine a tool that could group together all of the various profile pages of each of your friends, so you could keep up with them in one place rather than twenty.

Feed subscribe element: Get it on Blogger in draft, yo!