Trackback and commenting howto
Sunday, May 15, 2005Even if you use Blogger or another blogging platform that doesn't have built-in trackback, you can have trackback for your blog. This post explains how to:
- include just Haloscan trackback (which is free) on your blog without their comments system (I combine Haloscan trackback with Blogger commenting - see this post, which also compares the two commenting systems and discusses why I moved back to Blogger commenting)
- include code to enable trackback auto-discovery for your posts
- include just Haloscan commenting without their trackback (in fact I use both Haloscan and Blogger commenting for now, as older comments on my blog are still on Haloscan - so effectively I've added Haloscan commenting to Blogger commenting or perhaps vice versa), and
- use Forret trackback, plus a template hack for it to effectively automate sending a trackback ping even if you're on Blogger (it's an alternative free trackback system, one-way only).
This post assumes of course that you've signed up for Haloscan. What I write here is mostly Blogger-specific but I've tried to explain which bits to change for other platforms and (if I know it) how.
Haloscan trackback
To use just Haloscan trackback:1. Include in your blog template between the <head> and </head> tags this code:
<script type="text/javascript" src="http://www.haloscan.com/load/YourHaloscanUsername/"></script>
changing YourHaloscanUsername to your own Haloscan user first. (If you're not sure what your username is - though you ought to be as you signed up with it! - you can check it by going to the Haloscan Instructions/Code page, just click Next and it'll show you similar code; just take what's after "/load/").
You need that code there if you use any Haloscan service, whether trackback only, commenting only or both.
2. In your template, between the <Blogger> and </Blogger> tags (or whatever else is the shorthand on your blog platform for cycling or looping through the posts on your main page - e.g. for Wordpress (I think, though I'm not sure yet) it's betweeen <?php if (have_posts()) : while (have_posts()) : the_post(); ?> and <?php endwhile; else: ?><p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>), where you want the trackback link to appear, add this code:
<a href="http://www.haloscan.com/tb/YourHaloscanUsername/<$BlogItemNumber$>/" alt="Trackback" onclick="HaloScanTB('<$BlogItemNumber$>'); return false;" target="_self"><script type="text/javascript">postCountTB('<$BlogItemNumber$>'); </script><noscript>Trackback</noscript></a>
Again change YourHaloscanUsername to your own username. If you don't use Blogger you'll also need to change <$BlogItemNumber$> each time it occurs to whatever represents the unique ID of each post on your blog platform. (Check the links on the Haloscan's Instructions/Code page but I think it's '<$MTEntryID$>' for Movable Type and '<?php the_ID(); ?>' for Wordpress).
To style the link just add e.g. class="trackback-link" after the "<a " and create the appropriate class as you wish.
On my blog I inserted the code just before my Blogger commenting code in two places, as I have separate sections for my main page and my item page/post page (I won't go into that code here, I think it's explained adequately in Blogger's help page on comment tags but if anyone wants a deconstruction of that too please post a comment to that effect).
That's it!
Trackback autodiscovery
Some blog platforms such as Movable Type have trackback autodiscovery. This means that a blogger using that platform can be idle about having to do manual trackbacks to the posts they're writing about and linking to. If they turn on trackback auto-discovery (see Movable Type's explanation under the Auto-discovery section) then it checks the links in their post and if the blog post linked to has the trackback autodiscovery code in it (it's invisible), a trackback ping will automatically be sent to the post linked to without having to manually fill in any URLs to ping.So, including the code for trackback autodiscovery helps other people who are writing about your posts to trackback to it. I include it just after my trackback code, above, in both my main page and my post page/item page.
<!-- Trackback Auto-discovery RDF Code
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="<$BlogItemPermalinkURL$>"
dc:identifier="<$BlogItemPermalinkURL$>"
dc:title="<$BlogItemTitle$>"
trackback:ping="http://haloscan.com/tb/YourHaloscanUsername/<$BlogItemNumber$>" />
</rdf:RDF>
-->
Again if you're not on Blogger you'll need first to change the Blogger-specific tags to whatever represents your post permalink (<$BlogItemPermalinkURL$>), your post title and unique post ID on your platform.
Haloscan commenting
I've retained Haloscan commenting for historical purposes, till I get round to transferring old Haloscan comments to Blogger (nothing fancier than copy/paste, though I'd better get a move on for the earlier comments!).To do this, first include the code between your head tags as mentioned above. It's needed for using any Haloscan service.
Then include the following code in my template (on Blogger put it between the <BlogItemCommentsEnabled> and </BlogItemCommentsEnabled> tags so that comments will only display for posts where you've ticked Yes for "Allow New Comments on this Post" when creating the Post. Those tags would themselves be between the <Blogger> and </Blogger> tags too.):
<a href="http://www.haloscan.com/comments/<$BlogItemNumber$>/" alt="Comments" onclick="HaloScan('<$BlogItemNumber$>'); return false;" target="_self">*Your text here<script type="text/javascript">postCount('<$BlogItemNumber$>');</script><noscript>Haloscan comments</noscript></a>Again for other platforms change <$BlogItemNumber$> to whatever suits for your platform, you can probably guess it from the code given by Haloscan via their Instructions/Code page if you don't know it already.
If anyone's interested in dissecting that further, this is the bit of the code which displays as something like "Comment (0)", "Comment (1)" and "Comments (2)" etc. when you view your blog page:
<script type="text/javascript">postCount('<$BlogItemNumber$>');</script>.The Haloscan Settings in the Comment link text section defaults to "Comment (0)", "Comment (1)" and "Comments (#)", and I decided to change that to display as "X old Haloscan comment(s)" by tweaking my Haloscan Settings' Comment link text section to show 0, 1 and # instead, respectively, and using this code:
<a href="http://www.haloscan.com/comments/improbulus/<$BlogItemNumber$>/" alt="Comments" onclick="HaloScan('<$BlogItemNumber$>'); return false;" target="_self"> View <script type="text/javascript">postCount('<$BlogItemNumber$>');</script>old Haloscan comment(s)<noscript>View old Haloscan comment(s)</noscript></a>- which displays as "View X old Haloscan comments". (You could change the Haloscan Settings to something other than "Comment" if you wish, I just preferred it to output the number of comments so I could add the accompanying text myself in my template.)
Of course if you're not running two parallel systems you can delete the "old" and change the text as you like.
Forret's free trackback tool
I found a handy free tool to send a trackback ping to another blog post that you're writing about (i.e. create a trackback to someone else's blog which is trackback-enabled, without using Haloscan), so that when someone clicks the Trackback link on that other blog, they'll get to your post: the form on Forret.You can use the form as is after you've written your post - fill the name of your blog, post title, excerpt from your post, the trackback URL of the other blog's post, and the URL of your own post that's commenting on the other blog's post.
Or alternatively, as explained on Forret, you can edit your template to create a link on your blog page so that after you've published post, you just click that link and the form appears with everything already filled in except the trackback URLs for the other blog posts that you're writing about.
To do this just add the link
http://www.forret.com/tools/trackback.asp?title=<$BlogItemTitle$>&blog_name=<$BlogTitle$>&url=<$BlogItemPermalinkURL$>between your <ItemPage> and </ItemPage> tags (within the <Blogger> and </Blogger> tags). Note that this is a bit longer than what's suggested on the Forret page - it's better, I think, because it automatically fills in your post permalink too. As an example you can use the code:
<a href="http://www.forret.com/tools/trackback.asp?title=<$BlogItemTitle$>&blog_name=<$BlogTitle$>&url=<$BlogItemPermalinkURL$>">Send Forret trackback ping</a>
Try the "Test Forret trackback" link in my test blog to see what it does.
How to hide text or links so that only you can see them
Here's a further twist for Blogger users which some people may like. You can hide that link (and indeed any links or text) so that it's only visible to you, and only when you're logged in, by preceding it with<span class="item-control admin-XXXXXXX pid-YYYYYYY">
and following it with
</span> i.e. (I've put those "admin-only" surrounding tags in bold below):
<span class="item-control admin-XXXXXXX pid-YYYYYYY"><a href="http://www.forret.com/tools/trackback.asp?title=<$BlogItemTitle$>&blog_name=<$BlogTitle$>&url=<$BlogItemPermalinkURL$>">Send Forret trackback ping</a></span>- where admin-XXXXXXX pid-YYYYYYY and the blog ID XXXXXX must be changed to what's unique to your blog. (To find out what they are, see the Blogger help: this page for admin and pid (look under the "Making it Conditional" heading; to enable Quick Edit links see the second para. of this page), and see this page for how to find your blog ID - but if anything's not clear from that just post a comment and I'll try to help).
I don't use this tool on my blog because as explained in my previous post I believe mutuality is only fair - I should allow people to send trackback pings to my post too, which I do via Haloscan (so I may as well use Haloscan to send my own trackback pings). This tool however just lets you send trackback pings to other blog posts, without letting others trackback to your own blog. I could use it but I don't. But that's just me. If you don't use Haloscan at all, it's very handy for sending trackback pings to blogs you write about.
Usual stuff about changing the Blogger-specific stuff if you're not on Blogger.
Technorati Tags: blog, blogs, blogging, blogging tools, blog tools, comment, comments, commenting, trackback, Blogger, Blogger.com, Haloscan, howto, tutorial, tutorials, template hacks, Improbulus, A Consuming Experience, Consuming Experience
« Home | Previous Post »
Links to this post on:
Create link here by posting on Blogger
37 Comment(s):
Great Tip! Thanks!
Chris Clark's Web Site
(By Chris Clark, at Friday, June 03, 2005 4:01:00 AM) Edit Comment
i didn;t know a thing about using Trackback and the relevent coding involved. this helped a bundle... thanks :)
(By David, at Wednesday, July 06, 2005 3:53:00 AM) Edit Comment
You're welcome Chris & David, glad it was useful!
Cheers
Imp.
(By Improbulus, at Saturday, July 09, 2005 7:53:00 PM) Edit Comment
Is there anyway I can display my Haloscan comments along with the post without having the popup?
Blogger commenting has this feature where-in comments are displayed along with the post on the main blog. Any ideas on how to acheive that with Haloscan would be much appreciated.
Thanks
>Sri
(By Sri, at Sunday, July 10, 2005 9:44:00 AM) Edit Comment
Thanks for this post, I'm new to blogging and I'm hoping that I've managed to use your info to get my trackbacks working properly. Fingers crossed anyway :o)
(By Kat, at Tuesday, July 12, 2005 6:51:00 PM) Edit Comment
Sorry Sri I don't, though I'm sure it's possible (my Javascript isn't up to it yet!).
Best try the Haloscan forums, I'm sure someone there will be able to help. Good luck!
Glad that's helped Kat. And your trackback is indeed working, I tested it.
(By Improbulus, at Thursday, July 14, 2005 9:04:00 AM) Edit Comment
thanks man huge help. i was looking for a way to keep blogger comments as is but still use haloscan trackback.
(By zilla, at Saturday, July 16, 2005 11:45:00 PM) Edit Comment
Thanks for a great post.
(By Anonymous, at Friday, July 29, 2005 10:07:00 AM) Edit Comment
Really great help and advice, thank you so much again!
(By ritzy, at Friday, July 29, 2005 5:56:00 PM) Edit Comment
When I installed Haloscan, it works the comments on my main page, but when I go to the archives it still uses Blogger commenting. What should I do?
(By Colm, at Friday, August 05, 2005 9:50:00 AM) Edit Comment
Glad it helped, zilla, anon & ritzy!
Colm - I'm not sure what you mean. Your archive posts (June 2005) seem to be using Haloscan comments too (as well as your main page), which I guess is what you want. Maybe you've sorted it now? Or is it that you want to use Blogger comments for both?
(By Improbulus, at Sunday, August 07, 2005 2:14:00 PM) Edit Comment
Sorry, should have made myself clearer. The Haloscan comments in the archive work, but if you hit Previous Posts, then they revert back to Blogger comments.
(By Colm, at Monday, August 08, 2005 10:55:00 AM) Edit Comment
So.. There is an aggregation blog site (austinbloggers.org) that I've started posting my blog's entries to. Not sure if the answer is already here: Is it possible to have blogger automatically send a trackback ping to austinbloggers.org everytime I create a new entry on my blog? Thanks.
(By pdm, at Friday, August 12, 2005 5:25:00 PM) Edit Comment
Colm, that's because you need to include the Haloscan code for your item pages as well as your main/archive pages. In your template look for the bit that begins
<!-- Begin #comments -->
<ItemPage>
<div id="comments">
and change the comment code between that and the next </ItemPage> to the Haloscan code in exactly the same way as you did for the main part of your template. Hope that helps.
(By Improbulus, at Friday, August 12, 2005 10:35:00 PM) Edit Comment
pdm, if you use a platform that supports categories it looks like you can set up a category that automatically sends pings to http://www.austinbloggers.org/cgi-bin/postping. But if you use Blogger, the best you can do I think is to make use of Forret and add something like the following code to your template between the <Blogger> and the </Blogger> tags:
It doesn't send an automatic ping but it's a one click solution - it will produce a link for each post so that after you publish the post, by just clicking that link you can send a ping to austinbloggers for that post with all the required details filled in. But you may wish to hide the link by surrounding them with tags as mentioned in the "How to hide.." bit of my post above. Hope that helps.
(By Improbulus, at Friday, August 12, 2005 10:42:00 PM) Edit Comment
Improbulus, thanks for the info. I don't know much about categories. The only bell that rings is that in some platforms, there are "categories" you can group particular blog entries under (like, "food", "music", etc).. Maybe this is the "categories" you're talking about. So I guess I can't do the automatic thing, even if I want to send *all* my posts to the aggregation blog? (as opposed to a certain set of them).. Sigh. Well I can try the link you suggested. Thanks again.
(By pdm, at Saturday, August 13, 2005 3:41:00 AM) Edit Comment
Allrighty, I've put the hidden trackback ping link in. I'd also like to stick in an "exerpt=...." section into the trackback ping. Do you happen to know a way to say something like "exerpt='the first 20 words of this blog entry' " ?
(By pdm, at Saturday, August 13, 2005 4:11:00 AM) Edit Comment
There might be a way pdm, but it's beyond me! I'll see if my Magical Sheep pardner knows...
And yes, that's what I meant by categories.
(By Improbulus, at Monday, August 22, 2005 5:57:00 PM) Edit Comment
Thanks very much! Your advice was spot on.
(By geekgirl2, at Monday, August 22, 2005 11:32:00 PM) Edit Comment
Excellent guide! It took a bit to understand completely and implement but all is clear now.
(By Mirko, at Thursday, August 25, 2005 8:24:00 PM) Edit Comment
Thanks for your comments geekgirl2 and Mirko, glad to have been of help!
Mirko in what way did it take some understanding? Do let me know and if I can improve on the post, e.g. make some things clearer if needed, I will.
(By Improbulus, at Monday, August 29, 2005 10:47:00 PM) Edit Comment
Wow, this has been so helpful. Thank you so much.
I had been unable and unwilling to install trackback, because I wanted to keep the Blogger commenting system, but didn't know how to combine just the Haloscan trackback AND Blogger commenting.
Now I have it, thanks to you!
My question is perhaps trivials, but it knaws at me.
I noticed on my blog now that the comments and the trackback linnks look different.
"0 comments Trackback (0)" (they are also in different fonts, it seems).
Is there a way I can shape the "trackback" to look the same as the "comments"?
I am trying to make them look the same both in format and fonts:
"0 comments 0 trackback"
Thank you.
(By James J. Na, at Thursday, September 15, 2005 6:11:00 PM) Edit Comment
James, glad it's helpful. As for your question, in Haloscan go to your Settings link (from the menu on the left), under the heading "Trackback link text" change the fields to "0 Trackback", "1 Trackback" and "# Trackback" respectively and that should get you what you want. Have a look round that page, it's worth it. Hope that helps.
(By Improbulus, at Friday, September 23, 2005 10:58:00 PM) Edit Comment
Thanks. I figured that part out (setting the format of the text).
But I have not been able to figure out how to make the haloscan font type (on the trackback) match that of the blogger (comments).
Any idea? Thank you again.
(By James J. Na, at Tuesday, September 27, 2005 3:47:00 AM) Edit Comment
Sorry James I'm no CSS expert. Perhaps you could try adding "<span class="comment-link">" before the Haloscan code and "</span>" after it, and if that doesn't work, try the Haloscan forums? Or Blogger Forum?
(By Improbulus, at Friday, September 30, 2005 11:41:00 PM) Edit Comment
Wow! That "span" thing worked! What does it do?
Thank you so much for your help!
Regards,
James
(By James J. Na, at Thursday, October 20, 2005 6:15:00 AM) Edit Comment
Hi James, you're very welcome, glad it helped. It was just CSS, which you use to control the look (as opposed to content) of webpages including blogs. Like I said I'm no expert but try Googling for CSS tutorials, e.g. Echoecho or htmldog.
(By Improbulus, at Saturday, October 29, 2005 11:07:00 PM) Edit Comment
Thanks a lot. This post is very instructive and easy to understand. Canadian Citizenship Test
(By Anonymous, at Tuesday, June 06, 2006 10:25:00 AM) Edit Comment
I have been chasing a trackback problem for a while. Perhaps you can tell me if doing anything in your post above (great post, too) would help? Or if you could point the way to any real solution or troubleshooting that could lead to a solution, man I would be grateful. I have built my own blogs and sites, self taught, for about six years now. But this little gem is driving me mad.
Here's the dilly:
Using MT 3.3. I get trackbacks from (it seems) other MT installs. I get my own internal trackbacks. But I never seem to get other peoples. I am using Haloscan.
Do you have any clues that could help a desperate blogger who also does it as a non-paid love/job? If you could spare a few moments. Someone said that they think maybe the Haloscan prevents my getting these trackbacks. Do you think so?
Thank you.
blog linked below.
(By Nezua Limon Xolagrafik-Jonez, at Tuesday, December 12, 2006 6:58:00 PM) Edit Comment
i think i may have finally foudn a reason. it seems this "rdf" info that helps others autodetect your trackback URL is missing from my templates!
(By The Unapologetic Mexican, at Tuesday, December 12, 2006 9:48:00 PM) Edit Comment
whoops sorry. i wrote as nezua, too. just different ways of signing in. browsers. i asked the last trackback question. thanks bye.
(By The Unapologetic Mexican, at Tuesday, December 12, 2006 9:50:00 PM) Edit Comment
Well I've sent you a test trackback ping nezua, from this post via Haloscan. It reports a successful ping. Let's see if it works!
(By Improbulus, at Tuesday, December 12, 2006 9:53:00 PM) Edit Comment
Wow. your commenting was not working for me for a little while.
Your ping did not register! I don't get it.
I"ve put my best researched rdf info code into my Main Index template since last you last saw it. I'm not positive I got it all right. But it seems to be very hard to find info on this specific stuff, esp as related to MT, altho there is some stuff out there.
I cant send a successful trackback from an external source (wordpress), although I did get one from here: http://blog.radioleft.com/blog/_archives/2006/12/8/2559910.html . However, that may be an MT blog that doesn't say as much.
AH well. Back to searching for...something.
(By Nezua Limon Xolagrafik-Jonez, at Wednesday, December 13, 2006 1:09:00 AM) Edit Comment
it looks like the code is showing up in individual pages (viewing source of page) with the proper info plugged into the places they should be. so perhaps there is an issue btw Wordpress and MT. i will wait a few days, or for more links/pings from sites (i get linked pretty regularly so no sweat waiting), and suss it out in time. thanks for sending the ping, and for keeping the very informative blog up.
(By Nezua Limon Xolagrafik-Jonez, at Wednesday, December 13, 2006 1:25:00 AM) Edit Comment
Well Nezua I used Haloscan for the ping, not Wordpress, so I don't think it's a Wordpress issue. Sorry I can't help further but I'm just not up on MT. I think I heard you have to turn something on in an MT blog in order for trackback to work properly but I don't know what that is.
Have you definitely inserted the code to display trackback pings too (not just the trackback URL)?
(By Improbulus, at Wednesday, December 13, 2006 10:15:00 PM) Edit Comment
where can i find my admin number of blogger i cant find in any of the links you have give so can you please help me...please post a comment in my blog on the first post if you ngot solution my blog : www.manamoviemagic.blogspot.com
(By masti magic, at Monday, March 12, 2007 9:04:00 AM) Edit Comment
Masti Magic, you no longer need the admin number, just use "blog-admin" (without the quotes) instead of admin-XXXXXXX. Follow the instructions in the Blogger help file I linked to, which has been updated.
I'd like to update my post accordingly, but Blogger seems to mess up posts which contain code when I try to edit them, and it takes ages to fix, so I'm not risking that.
(By Improbulus, at Tuesday, March 20, 2007 9:42:00 PM) Edit Comment
Post a Comment | Subscribe to Post Comments [Atom] | Subscribe to all comments on all posts