A weblog by Tom Coates concerning future media, social software and the web of data
Quote of the month: "This is not a brothel, there are no prostitutes here"
You can subscribe to an RSS feed, read the disclaimer or explore the archives

How to do Trackbacks like plasticbag.org

Posted April 13, 2003 6:36 PM.

This is for a very narrow niche audience, but if you are one of the two or three people who have expressed an interest in how plasticbag.org embeds Trackback links at the end of each entry then here's how you do it. Only a limited amount of computer magic is undertaken. Basically on both the main index template for the site and the individual template for each entry (and any other archiving templates you want to use), I insert this code directly after my <$MTEntryBody$> tag:

<MTEntryIfAllowPings>
<ul style="list-style: none;">
<MTPings>
<li> &rarr; <$MTPingBlogName$>: <a href="<$MTPingURL$>" title="Trackback from <$MTPingBlogName$>"><$MTPingTitle$></a></li>
</MTPings>
</ul>
</MTEntryIfAllowPings>

Don't forget, in order for autodiscovery to work when someone else does pings your site you have to make sure that you've included the <$MTEntryTrackbackData$> tag in your template. I don't know if there's a restriction on where it can be placed. I just stick it directly after my <MTEntries> tag.

Remember: Most of the archive templates will not automatically rebuild every time you get a trackback ping, but they will if they get a comment - so either leave the your comments on or run a rebuild every few days just to make sure that everything's kept up to date.

Trackbacks

People who have linked to 'How to do Trackbacks like plasticbag.org' (What is a trackback?)

Comments

Please stay on-topic, informative and polite. I reserve the right to remove comments for whatever vague capricious reasons seem reasonable at the time.

Heh. No wonder you're a fan of autodiscovery rather than exposing the TB URL - I'd never looked at yours before. I still think autodiscovery will be the death of TB, though: if every ping is the result of someone intentionally saying "I think people who read that entry should read mine, so I'll either start with a bookmarklet from his page, or copy-and-paste the TB URL from it" then when you read an entry you are interested in, it's worth your time to also read the entries that pinged it, while if everyone turns on autodiscovery, the bulk of the pings will be from "Tom is a genius. Read [link]this[/link].", and people will quickly learn that it's not worth the trouble to look at them. Which is hardly on-topic.

Do you find that showing pings on the archive pages, but not rebuilding them when pinged, gives you more multiple pings? At least in the early days, people would send a ping, then go look at the pinged page to be sure it showed up, and if it didn't they would keep pinging until it did. I suppose hiding the ping URL, together with 2.6x logging actual ping errors, would cut down on that somewhat.

Posted by: Phil Ringnalda at April 13, 2003 8:00 PM

"but if you are one of the two or three people who have expressed an interest"
Surely you exaggerate?

Posted by: Cunt at April 13, 2003 8:19 PM

So - Mr Cunt - which particular branch of Energis do you work in? Are you really based in Birmingham? And you're on their POP network I see... I wonder what your employers would say if they were provided with some of your recent posting activity, the IP address that you were posting from and the time you posted it. They've even been really helpful and provided me with a nice e-mail address ( abuse@energis.com ) that I could use to get in touch with them. I'm doing this to make it clear that you're almost never as anonymous as you might like to think you are, and that perhaps in future if you're planning to slap the word 'cunt' around someone else's site, you might have the courage to do so under your own name...

Posted by: Tom Coates at April 13, 2003 9:40 PM

Phil - yeah - my trackback URLs are a bit nightmarish. It's the same problem I have with the preview functionality in comments - they both use the URL of the domain I have MT installed under. Also, in order to use Pair's CGI processes to their best extent, I have to use cgiwrap, which makes the URL even longer and more disorganised. It's very frustrating. You have a point with trackbacks coming from small asides - but I think that might be a problem with the MT UI more than anything else. Pretty much everything else is set as a preference at a global level, but can be over-ridden on individual posts. But not pinging - you can't say on an individual post you make "don't make this ping everyone". The other point I'd make is that since people can ping without actually linking to the post in question (if you use the manual process) there's phenomenal potential for individuals to abuse things or to build connections where none should rightly exist. At least autodiscovery makes links necessarily reciprocal (if you hide the manual process). Not to say that it can't be gamed of course - but that it puts a barrier in place...

Posted by: Tom Coates at April 13, 2003 10:06 PM

You can get round the problem of the trackback list not updating dynamically if you're using PHP by including the trackback CGI script in the page, eg: include("$MTCGIPath$mt-tb.cgi?__mode=view&entry_id=$MTEntryID$");
(I left the angle brackets off the Movable Type tags so they don't disappear in this coment). I don't know if this works with .shtml? The downside is a bit more server overhead as the CGI is run each time your page loads.

Posted by: Phil at April 14, 2003 12:47 AM


You are the biggest trackback queen, ever!

Posted by: tim at April 14, 2003 3:29 AM

Humph! I'm just trying to be helpful! It took me ages to get my head around it, and I assume that other people might like some help as well - so I talk about it occasionally. I'm gonna come around your house and whup yo ass now...

Posted by: Tom Coates at April 14, 2003 9:44 AM

I, for one, thank you for the excellent public service. I actually understand Trackback now, in a practical sense anyway. And thanks for the code fragment - I can make my own a bit better. Now if only people actually tracked back to me...

Posted by: MacDara at April 14, 2003 8:07 PM

Well, i've prayed for you to post this exact code on Plasticbag when you first post about the trackback subject, but it was a so-obvious request that I thought maybe you didn't want to reveal some well-written code. ;) So, I wrote one by myself. And now you appear with the whole thing! But it's okay, it was good to check if all things are alright with mine, and they are (my code has just one little thing different, I believe it's MTPingID tag). Thank you for your post and for the open-source blog.

Posted by: nando at April 16, 2003 3:05 PM

Cheers for sharing this Tom. I think it's an invaluable piece of blogging community service.

Posted by: Marcus at April 16, 2003 5:17 PM

I'd like to say thank you. I can't remember if I added my voice to those who asked you for this or not, but I meant to. Thanks anyway.

Posted by: Alan at April 17, 2003 12:32 PM

Once I saw the 'TrackBack light of day' (thanks in part to yourself), I decided to implement them in the same way as you have. However, I had no real idea as to whether it had worked or not, as like MacDara, I too have the same problem of not getting reciprocal links back to my site.

I'm so glad that you decided to put up the code though Tom, as now, by seeing that my coding is identical to yours, at least I can confirm that it's not me (for a change)... ~; )

Posted by: s3d at April 22, 2003 4:24 PM

Want to add your opinion?

© 1999-2007 Tom Coates