XFN Friendly Link List With Movable Type
January 30, 2004 7 | Comments (Closed)
There are many ways to use Movable Type to create a link list or blog roll. Jon Hicks has a great explanation of how to do this and I’m going to add my own, which is similar. I can’t show it yet, but I hope the explanation will give you a good idea of how it all works.
Before I start I want to give you an idea of what I wanted to do. I felt like the links in my sidebar were getting a bit long, and yet I wanted to do more with them. I wanted a way that I could “bookmark” great sites to my site, give some great Web sites the props they deserve and say a little something about those sites.
I decided to work on a modified version of my Quicklinks feature. I wanted to treat each link as a separate entry that I could take comments on, have an extended entry for and easily “promote” to the front page via Quicklinks. I also didn’t want to build something custom. Oh and I wanted it to be XFN friendly.
A quick side note. I chose to go with XFN because it’s based on simple XHTML. I realize that Movable Type could have future support for FOAF and/or XFN, but I didn’t want to wait and what I ended up with should be fairly flexible.
So, each link starts out as an entry. I create and entry with a category of “Site Link” then I enter the field as follows:
- Title — This is the title of the link.
- Entry Body — Here I say a few words about the site. This goes into the “title” tag of the link as well as a paragraph under the link. This usually won’t be very long.
- Extended Entry — I use this to link to another post if needed. I thought about just adding extended text, but that was problematic to display and the only times I’ve done this it actually warranted a separate post. What’s even nicer is that I can link to a post on someone else’s site with this. Too cool.
- Excerpt — This is the actual URL of the site.
- Keywords — I use this to store my XFN attributes. I can use this in two ways. These will be added the the links “rel” attribute, if there, and by using the MTRelatedByKeyword, I can organize these links by relation if I ever want to.
At this point I make sure there is no text formatting and publish. If I want to promote this to my Quicklinks on the homepage, I simple add that secondary category. At some point I hope to use subcategories to organize further, but until Movable Type has better category management I’ll hold off.
Now the template takes over. I built a special index template that will display these links how I want. The code to build the links looks like this:
<MTEntries category="Site Link" sort_by="title" sort_order="ascend">
<MTIfEntrySummary>
<h3><a href="<MTEntrySummary encode_html="1">" title="<$MTEntryTitle$>"< MTIfNonEmpty tag="MTEntryKeywords"> rel="<$MTEntryKeywords$>"</MTIfNonEmpty>> <$MTEntryTitle$></a></h3>
</MTIfEntrySummary>
<p class="sitelink"><$MTEntryBody smarty_pants="1"$><br /> <a href="<$MTEntryLink$>#comments" title="Comment on <$MTEntryTitle$>" > <$MTEntryCommentCount$> Comments</a> <MTIfNonEmpty tag="MTEntryMore"> | <a href="<MTEntryMore>" title="More about <$MTEntryTitle$>">More »</a></MTIfNonEmpty></p>
</MTEntries>
What this builds is a list of entries that look something like this:
Chopping Block
Great design…and oranges!
0 Comments | More »Designologue
It’s like mass Photoshop tennis, but different. Very fun. Via Sidesh0w.
0 Comments | More »
There are still a few very minor issues when it comes to the actual entries themselves and the categories. I hope to work those out, but even if I can’t I don’t think it’ll be muc of a problem.
All in all this allows for a really flexible list of links that takes advantages of XFN relationships, provides many ways to categories and organize and allows users to comment on sites they like or think interesting.
It’s also pretty easy to maintain. I can just create a quick post when I find a site I feel worthy to add to the list. Much easier than manually editing a site list template. I imagine there could be an easier way to do this, but hey, it took me all of an hour to get it set up and for the flexibility it gives me it can’t get much better than that!
Filed under: Web Development
Comments
1. Doug said:
Thanks for writing this up Keith. It’s almost identical to the way I’ve set up the Sites list in my SeeAlso section, and the Frequented Sites on my front page. Except that you’re enabling comments, and our Entry Body and Excerpt fields are swapped for URLs and short descriptions.
Someone just emailed me yesterday asking how I set up the link list. Now I can just forward people like that directly to this entry…
Posted on January 30, 2004 02:35 PM | #
2. Gilbert Lee said:
Will this be a new MT plug-in? Free?
Posted on January 30, 2004 03:17 PM | #
3. Keith said:
Doug, glad I could help out, point away!
Gilbert, as much as I know about MT, I don’t know Jack about building plugins. I’m not sure if this would work as a plugin anyway as it’s more of a process that uses other plugins. Feel free to use that code if you like though.
Posted on January 30, 2004 03:33 PM | #
4. Dan Cederholm said:
Excellent. Just curious if you had to create a new weblog in MT to do this? Otherwise, I would assume the links would show up in the main column?
Thanks for writing this up.
Posted on January 30, 2004 03:36 PM | #
5. Keith said:
Dan, this doesn’t use a seperate blog, at least for now, which can be a tad bit problematic. The problem isn’t the main page (I just exclude the “Site Link” and “Quicklink” categories from the MTEntries tag) but I do have a bit of an issue with the display on the individual entry pages for these links.
As I sometimes use the Extended Entry field for a link to an extended entry either here or elsewhere (as seen in the example above where I link to Ethan’s entry) and I also use Extended Entry as it’s intended on other “regular” posts. Since I can’t differentiate between the two this causes the link to show up “naked” – un-linked and un-styled.
The thing is the actual entry for these links doesn’t serve any real purpose except comments, so I think I can live with that until I find a better solution.
I thought about building a new blog for this, but I kind of want to keep everything together as much as possible. I admit this could come back to haunt me.
Certainly the same technique could be applied to a seperate blog and pulled in via the MTOtherBlog plugin.
Posted on January 30, 2004 03:47 PM | #
6. Patrick said:
I did this a while ago and wrote up how I did it here: http://www.ronincyberpunk.com/archives/001701.html
I got tired of waiting for blogrolling’s js file to load. Also, you can use MT’s bookmarklet to easily add a link to your site.
As for excluding the links from the front page, I didn’t - I just let them be shown. It’s a good way to draw attention to your new links.
Posted on January 31, 2004 07:21 AM | #
7. Keith said:
Patrick, I’ve had a few comments and questions about why I exclude links from the front page.
I don’t really exclude them, it’s just that I’m using this functionality for two different purposes. That and my list of links was getting too long so I decided to move it to a separate page.
For example, say I discover a really great photography site. I want to let people know about it, so I add it to my Quicklinks archive and it appears on the home page under “Quicklinks to Good Stuff.”
But then I decide I really like this site and want to add it to my main links page (which will replace the long list I’ve got currently on the home page), I just add the “Site Link” category.
I’d wouldn’t do this for most Quicklinks as they’re usually articles and things of that nature.
Posted on January 31, 2004 09:14 AM | #
Comments are now closed