The Logical Philosopher

Wednesday, September 06, 2006

Getting Haloscan to work in Beta Blogger

For all you Beta Bloggers: Haloscan comments & trackback do work in Beta!
For all you non-technical, loyal LP readers: All regular comments are back up!

Finally, after (ironically) using google and not finding the answer I searched elsewhere on the Haloscan forum. Between some guessing and the comments of Wiiiai's and Now That's Amateur , I got them up and running.

Here's how to work it, which was posted on the forum as well:

Step 1:
Turn on the widgets and find the following 3 lines of code:

<span class='post-comment-link' >
<b:if cond='data:blog.pageType != "item" '>
<b:if cond='data:post.allowComments'>

Step 2: (which Wiiiai didn't include and it took me forever to figure it out)
DELETE the code that is in between the code above and the "<'/b:if'>" that comes next. If you don't do this you'll see both the blogger comments AND the haloscan comments come up. I saved them in a text file in case I need them back.

Step 3:
Insert the following (the XXXX being your haloscan user name):

<script src='' type='text/javascript'> </script>
<a expr:href='"javascript:HaloScan(" + "\"" + + "\"" + ");"' target='_self'>
<script type='text/javascript'>postCount('<>');</script>

That's it.

UPDATE: it seems the footer code also needs ported into the spot when a post shows up on it's own page. Once I get it working, I will repost where to add that in also. Right now I have Haloscan to turn on in place of Blogger comments, but it may be easier to recode the text to work the opposite using the else/if statements - Haloscan turns on when Blogger turns off.

UPDATE 2: to add the code in the single post footer you need to drop in the SAME code as above, this time after the following code:

< id="'comments'" var="'post'">
< id="'comments'">
< name="'comments'/">
< 'h4' >

Note that both the blogger AND Haloscan comments will come up unless you delete the blogger code that comes under the < 'h4' >(which may be different in other templates).

UPDATE 3: Code in main section was updated - there was a missing portion of code the disappeared when blogger beta posted it! Arrg!

UPDATE 4: I've gotten a few hundered hits to this post, meaning there is a need for beta workarounds. If you are looking for other beta hacks check out Hackosphere, it's got a few gems in it.

UPDATE 5: If you came here just looking for the code using and are using Firefox, you may be interested in the follow-up article I did on Social Networking & Innovators/Early Adopters and their use of Firefox.

UPDATE 6: Peter at Utter Muttering got the trackback working. In the comment on this post he says "I just got trackback working (I think) by adding identical code and changing "HaloScan(...)" to "HaloScanTB(...)" and "postCount(...)" to "postCountTB(...)". It appears to be working correctly." Note that you need to add this new feature as a second set of code to your template.

UPDATE 7: I had a few emails about adding another update to clarify some things. Apparently for some templates you need to delete to the SECOND <b:if ... to get rid of the Blogger comments and the "invalid XML" error.

If you were able to use the hack, go digg it for me! Thanks.