Hacking the Blog: Trackbacks ... in Hacking
gconf has posted an article on how to add trackbacks to your blog. So, what in the world is a trackback? Here's a quote from Movable Type's Beginner's Guide to Trackback:
In a nutshell, TrackBack was designed to provide a method of notification between websites: it is a method of person A saying to person B, "This is something you may be interested in." To do that, person A sends a TrackBack ping to person B.
And why would person B be interested in what person A has to say?
- Person A has written a post on his own weblog that comments on a post in Person B's weblog. This is a form of remote comments--rather than posting the comment directly on Person B's weblog, Person A posts it on his own weblog, then sends a TrackBack ping to notify Person B.
- Person A has written a post on a topic that a group of people are interested in. This is a form of content aggregation--by sending a TrackBack ping to a central server, visitors can read all posts about that topic. For example, imagine a site which collects weblog posts about Justin Timberlake. Anyone interested in reading about JT could look at this site to keep updated on what other webloggers were saying about his new album, a photo shoot in a magazine, etc.
Alright, so lets give it a whirl. Following gconf's instructions:
- New blog entry (which would be this one) ... check!
- Find a long textbox titled "Trackback" ... check!
- Copy trackback url into the textbox on the edit entry page and click the "Send Trackback" button ... check! To see this action, take a look at the screenshot. The Trackback box is at the bottom highlighted in yellow.
- After pressing the "Send Trackback" button, you should see a green status box. (screenshot)
Now if you go look at the comments on gconf's post, you'll see that this entry had been added there and prefixed with [Trackback].
Hacking the Blog ... in Hacking
I've been spending time researching Roller and slowly figuring out how to tweak the template. I'm constantly playing around with the style sheet, and seeing how much I can pull off there. So far it's been pretty simple - just tweaking values here and there. Initially the template used many styles that simply weren't defined, so it was a matter of adding them to the style sheet.
After reading gconf's blog, I was inspired to figure out how to add the category next to the entry title. Looking over Roller's macro documentation, I couldn't find the string I wanted. I was hoping there was a variation of showWeblogCategoryChooser, which is called in the beginning of the template:
<div id="Content">
<center>
<img src="http://blogs.sun.com/roller/resources/frosty/frostyland.title.v2.jpg"
width="435" height="120" border="0">
<p class="descrip">#showWebsiteDescription()</p>
#showWeblogCategoryChooser()<br>
</center>
#showWeblogEntries("_day" 15)
<hr />
#showReferers( 40 25 )
</div>
... but no such luck. Then I remembered reading that it is possible to subscribe to a blog's RSS feeds by category - so there had to be way then, right?. So off to the Roller Macro Reference to take a peek at the the rss velocimacro. And there it was in the template source:
<category>$entry.category.name</category>
So off to plug that in to my _day template file. And while I was at it, I made some other tweaks (spacing and alignment):
#foreach( $entry in $entries )
<a name="$entry.anchor" id="$entry.anchor"></a>
<b>$entry.title</b>
<span class="category"> ... <i>in</i> $entry.category.name</span>
$entry.text
<p align="right">
#showCommentsPageLink( $entry ) :
#showEntryPermalink( $entry ) :
<span class="dateStamp">($entry.pubTime)</span>
</p>
#end
I'm pleased with the results. It's not that hard, just takes a bit of persistence.
Next up is more style sheet tweaks and additions of classes, and to fix one of my biggest peaves, the <ul> tag. If you're a CSS hacker, you probably know about A List Apart. There's a great article about lists and how to customize the layout and appearance. You'd be surprised at what you can do with <ul>.