Movable Type's TrackBack system allows peer-to-peer communication and conversations between weblogs. Imagine that you write about a movie you just saw in an entry on your Movable Type-powered weblog. Another MT weblogger reads your entry, and wants to write an entry referencing your original post. He could just comment on your weblog, but he'd like to keep the post in his own database and host it on his site.
Using TrackBack, the other weblogger can automatically send a ping to your weblog, indicating that he has written an entry referencing your original post. This accomplishes two things:
You can use TrackBack for more than just communication on particular entries, however. You can also associate TrackBack pings URLs with categories in your weblog. Whenever you post an entry to that category, the URLs you have associated will automatically be notified of your post. This allows remote sites to keep a repository of references to posts all around the web.
For example, if you run a site about Perl, you might want to provide a repository of links to Perl articles on other weblogs. Using TrackBack, you can allow other weblogs to ping a particular category in your own weblog, whenever a new entry is posted that pertains to this category.
These are just examples of TrackBack usage. TrackBack itself is a framework for peer-to-peer communication between weblogs; it can track cross-weblog discussions, it can provide remote content repositories, it can emulate guest authoring, etc. The technical side of TrackBack is very simple: when you want to notify a remote site of your existence, you send a ping to that site. The format of these pings (simple HTTP GET requests) is discussed below. In the Movable Type implementation of TrackBack, we've added password protection to category pings, IP banning, automatic RSS output, and email notification of new pings.
In other words: we want TrackBack to benefit, and to be useful to, more than just Movable Type users. We want to encourage integration of this feature into other weblog tools; that's why we have documented the ping format below and have tried to make the basic framework very simple. Feel free to email us (trackback@movabletype.org) if you have questions.
If you are a new Movable Type user, the TrackBack tags are included in the default templates, so you are ready to use it as soon as you install Movable Type. You can skip down to Step 5.
If you are an existing MT user, you'll first need to set up your templates to handle TrackBack pings. Start at Step 1.
http://www.movabletype.org/default_templates.shtml#trackback
http://www.movabletype.org/default_styles.shtml
If you have a custom stylesheet, you can either customize the TrackBack Listing Template to match your site's styles, or add new CSS styles to your stylesheet for the classes .trackback-url, .trackback-body, and .trackback-post.
function OpenTrackback (c) { window.open(c, 'trackback', 'width=480,height=480,scrollbars=yes,status=yes'); }
Now, inside of your <MTEntries> tag, add the following code to display a link to the TrackBack listings for each entry:
<MTEntryIfAllowPings> | <a href="<$MTCGIPath$>mt-tb.cgi?__mode=view&entry_id=<$MTEntryID$>" onclick="OpenTrackback(this.href); return false">TrackBack (<$MTEntryTrackbackCount$>)</a> </MTEntryIfAllowPings>
<MTEntries>
tag:
<$MTEntryTrackbackData$>
Then, in your Individual Entry Archive Template, add this same tag anywhere in the template:
<$MTEntryTrackbackData$>
When you rebuild, this will add the necessary information to your public files to allow Movable Type's bookmarklet to parse out entries that allow TrackBack and to grab the ping URL for those entries.
This simplifies the process of referencing a post on another site using TrackBack.
If you are already using a bookmarklet, you will just need to recreate it using the same fields you are using now, plus the TrackBack items field. If you are not yet using a bookmarklet, you can create one.
Go to the Main menu, then click on Set Up Bookmarklets. Follow the instructions to create the new bookmarklet, and be sure to include the TrackBack items field.
You can test your bookmarklet by going to the following page in your browser:
http://www.movabletype.org/trackback/
Once your browser has loaded the page, click on your Movable Type bookmarklet. In the window that opens, you should see a pulldown menu at the top labelled Select a TrackBack entry to ping:. The menu contains a list of all of the TrackBack-enabled entries on the above page.
If you see the menu, your bookmarklet is working, and you're ready to start using TrackBack!
If you don't see that line, run mt-check.cgi to determine whether you have LWP::UserAgent installed. That module is required to use TrackBack.
TrackBack can be used in two general ways: to communicate between entries on different sites, or to communicate between categories on different sites. In addition, in each of these scenarios you can act as the content producer--where you are posting the entry--or you can act as the content gatherer--where you are gathering a list of entries posted regarding your TrackBack item (whether that be an entry or a category).
As a content producer: When you post a new entry and would like to ping an entry on a remote web site, you can either post using the Movable Type bookmarklet you set up above in Step 5 in Setting up TrackBack, or you can manually add the TrackBack ping URL of the remote site into the URLs to Ping box on the new/edit entry screen.
As a content producer: You can associate a list of TrackBack URLs with a category. When you post a new entry into this category on your own site, each of the URLs you have listed will be pinged with information about this new entry.
When a ping is sent to a TrackBack item on your site, in addition to saving the ping in the Movable Type database, the system updates an RSS feed for the TrackBack item. The XML output is saved in a file in your Local Archive Path named ID.xml, where ID is the numeric ID of the TrackBack item.
TrackBack uses a REST model for its pings in order to ensure that each TrackBack item has a unique URL (by the numeric ID of the TrackBack item).
http://foo.com/mt/mt-tb.cgi?tb_id=ID
where ID
is the numeric ID of the TrackBack item. The request parameters
are added on to the end of that URL, like this:
http://foo.com/mt/mt-tb.cgi?tb_id=ID&title=TITLE&url=URL
etc. The possible query parameters are: title (title of the entry);
excerpt (an excerpt of the entry, which, if longer than 255 characters,
will be cropped to 252 characters and ...
added at the end); url
(the permalink for the entry); and blog_name (the name of the weblog in
which the entry is posted).
A response is in a simple XML format to enable application-level error
detection (HTTP-level errors will be returned as such--for example, if the
TrackBack URL points to a non-existent location on the server, a 404
error will be returned from the ping).
A successful ping will return the following response:
<?xml version="1.0" encoding="iso-8859-1"?> <response> <error>0</error> </response>
A failed ping will return the following response:
<?xml version="1.0" encoding="iso-8859-1"?> <response> <error>1</error> <message>The error message</message> </response>
Applications should, of course, allow for the future addition of fields, if necessary. But the XML structure of the response will remain the same.
http://foo.com/mt/mt-tb.cgi?tb_id=ID&__mode=rss
where ID
is the numeric ID of the TrackBack item.
The response to this request will either be an error in the same format as
returned from the above request, or the list of TrackBack pings for that
item in RSS markup, wrapped in <response>
tags.
For example:
<?xml version="1.0" encoding="iso-8859-1"?> <response> <error>0</error> <rss version="0.91"><channel> <title>TrackBack Test</title> <link>http://this.is/the/trackback/item/link/</link> <description>Description of the TrackBack item</description> <language>en-us</language> <item> <title>TrackBack Demo</title> <link>http://this.is/the/permalink/</link> <description>Excerpt</description> </item> </channel> </rss></response>
Documentation on TrackBack-related elements are available here: