Friday, December 08, 2006

Testing Haloscan comment hack for Blogger Beta

Many people using the Haloscan comment system have complained that it does not work for Blogger Beta blogs. amrlion (close new window/tab to get back to this page) mentioned that there is a hack for that and gave this link Getting Haloscan to work in Blogger beta. (close new window to get back to this blog).

I tested the hack for this blog Good Health Articles (close new window to get back to this page).

I followed the instruction in that post, which is, first, to find this block of codes in the template with the widget expanded:

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

which I found somewhere in the middle of the template (use EDIT > FIND from the menu bar).

The next instruction is to do this:

"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."

that is, to delete the codes from <b:if cond='data:post.allowComments'> to the next <'/b:if'> and insert the following codes, (the XXXX being your haloscan user name):

<script src='http://www.haloscan.com/load/XXXX' type='text/javascript'> </script>
<a expr:href='"javascript:HaloScan(" + "\"" + data:post.id + "\"" + ");"' target='_self'>
<script type='text/javascript'>postCount('<data:post.id/>');</script>
</a>


I am using Ramani's 3 column template and what I found was this:

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

<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>
</b:if>
</span>


That is, instead of just one "<'/b:if'>" I found "</b:if>", and there were more than 1 "</b:if>". I deleted the portion up to the second "</b:if>" and replaced it with the above codes with the XXXX replaced with my Haloscan username.

That is, I deleted :

<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>


and replaced it with the given codes above, and thus ended up with this:

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

<b:if cond='data:post.allowComments'>
<script src='http://www.haloscan.com/load/blogsmith' type='text/javascript'> </script>
<a expr:href='"javascript:HaloScan(" + "\"" + data:post.id + "\"" + ");"' target='_self'>
<script type='text/javascript'>postCount('<data:post.id/>');</script>
</a>
</b:if>


There were a few updates, one of which I was required to look for the following:

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

I couldn't find it, and I didn't proceed with the instructions in the updates. However, what I found is that the hack worked for the main (index) page and the archive pages, but in the individual post pages (permalinks), the blog was still stuck with the Blogger comment system. Perhaps it was because I was using Ramani's 3 column template rather than the standard Blogger beta template. If you really want the Haloscan comment system to work for the individual post pages, you can try to proceed further than what I have done for this blog Good Health Articles

Update 9 December 2007: With a little hint from Logical Philosopher or amrlion (close new window/tab to get back to this page) and a little experimenting, got the HaloScan comment system into the individual post page. But the system exist together with the Blogger comment system. Got an email from Ron of Rodentia (close new window/tab to get back to this page) suggesting going to SETTINGS > COMMENTS and set "Comments" to "hide" which I did. I checked the individual post page, and sure enough, I get only Haloscan comment there, no Blogger comment. I checked the main page. None of the posts there had any COMMENT, neither Blogger comment or Haloscan comment. So that ended my little bit of experimenting. I reset the COMMENTS to show and I am back in business again with only Haloscan comment in the main page and the archive pages, and the Haloscan comment coexisting with the Blogger comment in the individual post page. I am going to see if I can get any suggestion from amrlion on how to get rid of the Blogger comment in the individual post page. If I do, and it succeeded, you will see an update here.

15 comments:

keda said...

hi. my comments appear to be working fine with haloscan, but i guess i shouldn't speak too soon.

actually i wanted to ask you a completely different question. i hope you don't mind. (i can't post it on the google groups page as i'm an english speaker in turkey who doesn't speak turkish and as google insists on switching to the local language i can't understand how to do anything!)

so what i would love help with is labels.

i have added labels to my posts, but when i click a label and the page opens it only shows about 7 of the most recent and i don't have an older posts link at the bottom of the page. could you tell me how to add one to the seperate label pages and even individual post pages please? i really don't want to take one of the new blogger layout templates as i like mine and don't want to start all over again. even if they do have that feature.
thank you.

Peter Chen said...

My experience with labels is that all posts with that label is displayed. Take this one for example which has 25 posts Label/testing.

Peter aka Enviroman
Enviroman Says

Julie Williams said...

Have very similar problem, first the template would parse, why can they not supply the changes to widget without trying to manipulate server side code

Robyn McMaster said...

I notice you no longer use Haloscan. I began to use it on my blog, but now I can't get my original template to work againg since Blogger won't let me save it. Got any advice? I want to go back to blogger comments. Haloscan has really messed me up.

Peter Chen said...

Hi Robyn,

I normally don't use hack that I don't intend to keep in my main blog. I normally do that in a demonstration blog, the link to which I have provided in the post. Regarding Haloscan messing up your template, I really wouldn't know about that. What I do know is that with the hack, you will have 2 comment systems in the individual posts.

If you want to clear up the mess in your blog, I supposed the easiest way is to upload a fresh template. Save all the customization first so that you can easily put them back in again after you put in a new template.

Peter
Dummies Guide to Google Blogger
"online book" in progress

Robyn McMaster said...

Thanks for getting back to me, Peter.

Scott said...

Good advice - I now have a "shadow" blog!

DD2 said...

I've been tying for weeks ot instal a haloscan templare comment box in my blog and I just can't seem to get it.
I was told that my bloc has to many things in it already, is that true?

Thanks for you reply
DD2

DDthesecond@hotmail.com

Peter Chen said...

Hi DD2,

To tell you the truth, I never like Haloscan comment and I only did this post because of readers. I am no expert in Haloscan.

You may want to try the new Haloscan Installation Wizard and if if that helps.

Peter (Blog*Star)
Google Generate revenue from your website with Google AdSense. Get something for your hardwork

Admin said...

how to change blogger comment editor in wysiwyg.
http://www.dlcomplete.com

Neil said...

Hello.. I never use haloscan but i am only use this because i need to post a comment on this and my comment appear perfectly.
Web Design Quote

Nathan KA said...

How can have "Leave a comment" option on pages.

For post it's coming properly. For pages, I'm unable to see leave comments option.

Please help me in this regard.

Page link

Peter @ Enviroman said...

Nathan, refer to How to enable comments for Blogger static pages

Nathan KA said...

Thanks a ton Peter. I never thought it to be simple as that, since I was struggling with it for more than half-an-hour with no hopes.

In-fact I moved my page to Post.
Always when you have time, please check out my blog and see if it is interesting.

Thanks Again.

Nathan KA said...

Thanks a ton, Peter. I never thought it to be that simple. I have been struggling to find it for more than half-an-hour with no hopes. In-fact I thought blogger doesn't have enable comments option for pages.

Also I have moved my content from Page to Post. I felt glad to see your reply to my query. When you have free time, please visit my blog and encourage me with your comments and suggestion as I'm new to it.