Singpolyma

Technical Blog

Comments on Main/Archive Page (Peek-a-Boo) in Blogger BETA

Posted on

There was a typo in this post! I finally found it. Your templates should be able to save after applying this hack now ;)

I have released an asynchronous version of this hack.

So now that people have stopped asking me for this feature (because I said I couldn't do it) I've done it! Screen-scraping to the rescue! If you re-install this hack you'll get more manageable code in your template, bug fixes for timezone logic, and comment author links. Finally! Yay! This also improves compatibility between this hack and my comment photos hack.

You can not link to author's blogs or profiles from the main page because that data is not available in the feed Blogger provides. Some day I may dream up a way to do this — or Blogger may start providing the information. For now, it's not happening.

Updated 2006-11-27 to work with new Native JSONP, should be faster now.

As I said back when I first released my BETA template, displaying comment data anywhere but on item pages in Blogger BETA is 'impossible'. That is what this hack overcomes. Both just plain displaying comments on main and also peek-a-boo comments are now possible (revised template coming soon ;) ).

  1. Go to the layout on your BETA blog and select 'Edit HTML'.
  2. Check the 'Expand Widget Templates' box.
  3. Paste the following code into the <head> section of the template:

    <script type="text/javascript">
    //<![CDATA[
    var comment_form_template = '<div class="commentelem"><div class="comment-poster">[[AUTHOR]]</div>\n'
    + '<div class="comment-body"><div class="innerCmntBody">[[BODY]]</div></div>\n'
    + '<div class="comment-timestamp"><a href="[[PERMALINK]]" title="comment permalink">[[DATE]]</a></div></div>\n';
    //]]>
    </script>

    <script src='http://jscripts.ning.com/get.php?xn_auth=no&amp;amp;id=2706908' type='text/javascript'></script>

    Advanced users will note that the first <script> section is taken from the asynchronous comment form code, and that if that is installed (presuming I get a version working for Blogger BETA) that the code only needs to be in here once. It can be changed to fit the code of the blog itself to improve appearance, etc. Kudos to Johan Sundström for his help with the date code.

  4. If you want peek-a-boo functionality, you will need this code in your <head> section somewhere as well:
    <script type="text/javascript">
       function toggleitem(postid,linkid,newtxt,displaytype) {
          if(!displaytype) {displaytype = 'block';}
          var whichpost = document.getElementById(postid);
          if (whichpost.style.display != "none") {
             whichpost.style.display = "none";
          } else {
             whichpost.style.display = displaytype;
          }
          if(linkid) {
                var lnk = document.getElementById(linkid);
                lnk.href = "javascript:toggleitem('"+postid+"','"+linkid+"','"+lnk.innerHTML+"');";
                lnk.innerHTML = newtxt;
           }
       }//end function toggleitem
    </script>
  5. Find the place in your template where the comments are generated on item pages, it will probably look something like this:
    <b:loop values='data:post.comments' var='comment'>
      <dt class='comment-author' expr:id='"comment-" + data:comment.id'>

    And directly before that, insert this code:

    <b:loop values='data:post.feedLinks' var='f'>
       <b:if cond='data:blog.pageType != "item"'>
          <script expr:src='data:f.url + "?alt=json-in-script&amp;amp;callback=peekaboo_comments_display"' type='text/javascript'/>
       </b:if>
    </b:loop>
  6. If you want to use peek-a-boo functionality put, find the code a little bit before that which you just inserted that looks something like:
    <b:includable id='comments' var='post'>
      <div class='comments' id='comments'>

    And replace that second line with:

       <div class='comments' expr:id='"comments" + data:post.id'>
    <b:if cond='data:blog.pageType != "item"'>
       <script type='text/javascript'>
          document.getElementById('comments<data:post.id/>').style.display = 'none';
       </script>
    </b:if>
  7. Next, find the post-generating code. It will look start something like this:
    <b:includable id='main' var='top'>
      <!– posts –>
  8. In this section there will be a block of code that looks something like:
    <b:if cond='data:blog.pageType == "item"'>
       <b:if cond='data:post.allowComments'>
          <b:include data='post' name='comments'/>
       </b:if>
    </b:if>

    Replace it with this:

       <b:if cond='data:post.allowComments'>
          <b:include data='post' name='comments'/>
       </b:if>
  9. If you want to use peek-a-boo functionality you need to find the post template section, which starts something like this:
    <b:includable id='post' var='post'>

    And then find the link to the comments area, which looks something like:

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

    And replace it with:

    <b:if cond='data:post.allowComments'>
       <a class='comment-link' expr:href='data:post.url + "#comments"' expr:onclick='"toggleitem(&amp;quot;comments" + data:post.id + "&amp;quot;);return false;"'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
    </b:if>
  10. Click 'Save Template' and, if it appears, 'Confirm & Save', then view your blog.

137 Responses

Anonymous

i do it as your method twice,but my all posts are hidden?
what's wrong may be i made?

Singpolyma

If the blog you tried it on was http://sunr.blogspot.com/ it looks like you've done a lot of hacking at the template yourself :) Perhaps you've introduced some case in the code I'd not run across before. Could you please email me your full template code (go to edit HTML, check the box, then cut-n-paste the textarea contents) so that I can look at it and determine how this should be implemented in that template?

Singpolyma

I have updated this post to fix some bugs that were found in it… try it again, it should work now :)

nhk

One of good reference that I ever found. Thanks for your resources leaving on my blog

wishes

nhk

Anonymous

Awesome hack. Thanks very much. Made the transition from classic to beta templates very easy.

Anonymous

There is a little bug I think: instead of out=out.replace(/\[\[BODY\]\]/,data.items[i].content);
you want out=out.replace(/\[\[BODY\]\]/,data.items[i].summary); in function peekaboo_comments_display()

Singpolyma

.content worked fine for me, either should usually work… what blog required .summary?

Anonymous

when I tried, the comment body would always be "undefined". So I suspected the output of xoxo script. I ran the script manually and received the following o/p: peekaboo_comments_display({"xmlns":"http://www.w3.org/2005/Atom","xmlns:opensearch":"http://a9.com/-/spec/opensearchrss/1.0/","id":"http://kousik.blogspot.com/feeds/3670026104565873298/comments/default","updated":"2006-10-16T01:33:11.294+05:30","title":"Hacking | Photography | Bird-Watching : Purple Swamphen (Porphyrio porphyrio)","link":[{"rel":"alternate","type":"text/html","href":"http://kousik.blogspot.com/2006/10/purple-swamphen-porphyrio-porphyrio.html"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"http://kousik.blogspot.com/feeds/3670026104565873298/comments/default"},{"rel":"http://schemas.google.com/g/2005#post","type":"application/atom+xml","href":"http://kousik.blogspot.com/feeds/3670026104565873298/comments/default"},{"rel":"self","type":"application/atom+xml","href":"http://kousik.blogspot.com/feeds/3670026104565873298/comments/default?max-results=25"}],"author":{"name":"/<0USIK"},"generator":{"text":"Blogger","version":"7.00","uri":"http://beta.blogger.com"},"opensearch:totalresults":"1","opensearch:startindex":"1","opensearch:itemsperpage":"25","items":[{"id":"http://kousik.blogspot.com/feeds/3670026104565873298/comments/default/1202086234087470172","published":"2006-10-16T01:33:00.000+05:30","updated":"2006-10-16T01:33:11.294+05:30","title":"welcome back","summary":"welcome back","link":"http://kousik.blogspot.com/2006/10/purple-swamphen-porphyrio-porphyrio.html#1202086234087470172","author":{"name":"TMaYaD","uri":"http://mvfb.blogsot.com"}}]});

You can see there is no content field, but I thought I could use summary instead.

But great hack, BTW!

Anonymous

Yes! Thank you!! :) I already used your peekaboo-comments hack before I swichted to Blogger Beta. And now I land to your blog again! Great work

Anonymous

I use Cool Iris Preview extension and I can see a post page which includes the comments when I hover over the comments link but if I click on comments it just opens and closes but it doesn't show the comments. I have been pretty careful with my hacks and I followed your directions exactly. Do you think the peekaboo hacks can be the problem? It's like the comments link has no target. Please help.

Anonymous

Oops, all of a sudden it started working. I think blogger was having a hiccup because I couldn't leave a comment here either. It looks good so far.

Anonymous

I can't seem to duplicate your problem. If I go to your page (http://debsquirkyweb.blogspot.com/) and click the comments links they just pop open like they're supposed to. The post page does not come up, nor do you leave the main page, they just pop out.

The comments link does still point its HREF to post-page#comments, but it never goes there when you click because the JavaScript that pops out the comments also disables that.

kca

Hi there,

I just would like to display the peek a boo comments and keep the origal Blogger comment form (not the asynchronous comment form ^^)… So tell me, which step in your post i should pass?

Anonymous

i'm success ,you're so great,thanks a lot!!

Anonymous

Do you mind me translating your hacks into chinese?

Singpolyma

@kca – none, this hack has absolutely nothing to do with the comment form. They're not even remotely related hacks.

@咖啡鱼 – not at all! Translate away ;) Just please be sure to credit me as the original source and give a link :)

Singpolyma

Some curious users have asked how one can make the peek-a-boo comments identical to the item pages. You change the first part of the code in step #3 so that the variable is being assigned a code template that matches your comments. When I get my template out, it will have this done for itself.

kca

Thanks now it s working liek a charm!

But i go a problem:

When you are using the peekaboo the comments are not displayed like the item page, do you have any idea how we can get ride on it?

Anonymous

Thanks so much, I've been waiting for this hack to switch to the beta template. On my classic blog I had a hack using cookies that told my readers how many comments are new since they last visited. Can you do that?

kca

so that the variable is being assigned a code template that matches your comments.

Alright,:)

Could you please repeat what you say, but this time just think you talk to baby of 5 years old?;)

Thanks!

kca

Never mind about my previous queestion, i just fix it.

But now i got an other one:
I just see some slowness in the peek a boo, do you know how can i host the external script inside the templates?;)

Anonymous

thanks for the hack!
if you wish to change comments styles, you need to create/change some style definitions in 'edit html':
change
#comments to .comments
#comments h4 to .comments h4
define
.comment-poster
.comment-footer a, .comment-footer
.innerCmntBody
.comment-timestamp

Singpolyma

@kca – glad you go it figured out :) If for some reason you wanted to host the external script inside your templates you can just go the the script's URL (from the SRC attribute of the <script> tag, &amp; becomes &) and cut-n-paste. Imho this could make it slower for page loading (hence why I didn't do it that way) because caching on the script no longer would work across pages. I am considering making an alternate version of this that does not load comments until you need them that would result in faster page load times :)

Anonymous

Hi,

I've installed this hack, it works fine, but I'm gettin a javascript error message on Internet Explorer: "items is null or not an object."

Singpolyma

Internet Explorer is known to give errors it shouldn't and generally be evil. As long as it is actually working it should all be cool :)

kca

Now eveything works great!:)

But an other question: I would like the opposite: by using the peek a boo to show the comments, and if the visitors want to hide them, they just click on the 'comment' in the post footer.

Singpolyma

To get this behaviour, remove the following code from step #6:

<script type='text/javascript'>
document.getElementById('comments<data:post.id/>').style.display = 'none';
</script>

kca

Damn! it s look great now, thanks a lot again, how can i thank you…? if i had a sister, i would send her to your house, but she's ugly, so :O) just say thanks huh?
^O^

Raquel

I wish you can fix this error on IE, some of my JS installed in my blog is not working good becasue of this error occur.

Anonymous

hi,

i tried using your hack but after following all the steps i couldn't get it working. When i click on 'comments', an empty space appears where the actual comment should be.

By the way, how did u do to have this easy 'leave your comment' dialog without going to a new page?

Tnks!

Anonymous

Hi Singpolyma,
I've installed your hack, it works fine. Is it possible to add a blank line between each comment? Thanks

Anonymous

@Rui Barreiros – I cannot find any of my code in your blog — did you take it back out?

The comment form is from this hack, but unfortunately will not work with Blogger BETA.

@protesto – Adding the following code to your <head> section should do the trick:

<style type="text/css">
.comment-timestamp {
margin-bottom: 2em;
}
</style>

Anonymous

Thanks for replying sing. I have one more question. The size of the comment font is smaller than default size now. I think it's because of your hack. How can I fix it? Example

Anonymous

Try:

<style type="text/css">
.comment-body {
font-size:14pt;
}
</style>

Change the 14 to the font point size you want :)

Anonymous

OK so what have I done? I'm getting a problem that a previous person had. When I click on comments it pops open but no comments. I then remembered I'd set comments to open in a new window so I switched that off and still no luck. I'm not getting a proper link when I hover over comments like I do with my other blogs. Could you take a look at Harwich to Hong Kong? Please tell me I've just simply cocked up somewhere….

Singpolyma

@Laura – There seems to have been a slight glitch in the way the code handled your particular blog. I have updated the code – please reinstall and see if that fixes it :)

Anonymous

Oh! thanks for your quick response but no luck. Just the same. Things may have got even worse now with my code tweaking…

Singpolyma

Ah, ok, I've updated the code yet again. If you reinstall and it still doesn't work, email me with your template and I'll try to do some hard-core debugging :)

Anonymous

Thanks Singy. I've got some crazy date stamp of the 1st January 1970 on my comments but at least I can see them now. Thanks for sticking with me! Doing a bit of an overhaul of this blog to make it a bit nicer and this helps lots.

Anonymous

…Oh crikey! Doesn't work for firefox on older posts and all comments are shown on older posts on Safari, anyway. I use Safari most, although blogger doesn't seem to see making it work a priority. The 'older posts link' doesn't work at all on this browser. I'll send my template.

Arto Kekkonen

Hi,

I installed the hack and did some template hacking myself, and it worked fine. Homewer, I noticed (by creating several blogs and testing) that as soon as I either change the blog's address or edit some page elements using the editor, the hack stops working – ie. clicking the link pops up the comment area but shows no comments.

Seems to be a bit random – adding a new element to the side bar didn't break it, but rearranging them did. So I undid all my changes. I also replaced all of the code with a copy I had taken before toying with the elements – but the peek-a-boo still doesn't work.

Any ideas of why this happens and how to get it working again?

Arto Kekkonen

Oh, and just to clarify – I didn't change the address with the blog in question, only the elements, so that shouldn't cause the problem.

Jan

I just installed it in my Test Blog and it works great. But there are two things that I'd like to see, if possible.
Is it possible to liknt the poster name to their profil on the main page?
And a second thing, can you give me a hint which css i have to change in what way to that the main and the item page have the same margin? the main page is like i want it now, but the indents on the item page are not :-(

Anonymous

Hey awesome hack. Worked so smoothly. I'm just a little fussy here. Is there anyway you can make the authors of the comments link to their profiles like it does in the post a comment page?

Thanks A million!

Anonymous

Thanks for your time and effort! Still getting the funny date on my comments though. They're ok when listed on the pop-up window to add a new comment but otherwise are stuck in the 1970s! The easiest thing would be to remove the time-stamp from my peek-a-boo comments altogether. Now where about is that in the template…..?

Singpolyma

@Arto Kekkonen – This may be caused by Blogger's default editor rewriting the template and removing the hack (or corrupting it). Shouldn't happen often, but if it does, just reinstall the hack from here :)

@Jan – comment-body is the class for the main comment text. You can not link to author's blogs or profiles from the main page because that data is not available in the feed Blogger provides.

@Laura – I still can't understand why it's messing up the dates for you and no-one else. To remove dates from the output of the hack though, just remove [[DATE]] from the code in step 3.

Anonymous

Thanks so much! The removing the date bit I even managed to work out for myself. I guess the 1st January is an important date??!!

kca

Singpolyma, Hello,

I my blog is a master piece ^^ with your hack, and with the json update rocks, i can see clearly the difference., thanks for your work.

Now i got a special request, do u think is possible to play with some cookies in order to give to the visitor the possibility to show or hide permanently the post, for example:

-Show/hide the post comments
-Hide all comments (main blog, archive, -and labels)permanetly
-Show all comments permanetly

Singpolyma

It's possible to do — I'll take a look when I get time, but I can't promise anything :)

Anonymous

Hello,

I've got my comments working correctly, sna I did a little tweaking in font size and such. My question is, why is it that the comments are opening below the (blue line) border between posts and into the post below?

Can I fix this? And does this make any sense at all? Heh.

Thanks in advance, I suck at this stuff.

http://celebritysmack.blogspot.com
http://celebritysmackblog.com

Singpolyma

@Spicy Pants – Your normal comments section on the item page is also after that line. If you want to move the main page section to before the line move this code:

<script src="http://celebritysmack.blogspot.com/feeds/3406064048280111796/comments/default?alt=json-in-script&amp;callback=peekaboo_comments_display" type="text/javascript"></script>

To before this line of code:

<p class="post-footer-line post-footer-line-3"></p>

That should do it :)

Anonymous

Great hack. Thanks!

I noticed, though, that if the blog feed setting is set to "none" (which also affects the comments feed), then the comments don't appear when you peek-a-boo. It drops down, but it's blank. Maybe this was the problem a few people had.

You might want to mention this. Under Site Feed (in the Settings tab), Blog Feed should be set to "full."

Thanks again,
Paul

Anonymous

hi, I didnt read through all the comments, but I`m kinda sure no one else might be a noob to ask such a stupid question, how do I change the color of comment to white? my font color is set to white in the template, still the comment text is black and hence unreadable. check it at notreallymybloganyways.blogspot.com I`m testing the emplate hacks on this first before I port it to my main blog.

Anonymous

I have one more Q. After adding Peek-a-Boo comments and a third column, my blog seems to freeze up at points when it is loading. It is driving me crazy! Is it fixible? Or is it caused by the amendments I have made?

THANKS AGAIN!

Anonymous

I love the hack. It's great stuff. One of my commenters mentioned that now it is a bit harder to actually LEAVE a comment after a long list of comments since you have to first expand them and then scroll to the bottom where the link is to leave a comment. Is there a way to easily just add a "leave a comment" link next to the link to expand the comments?

Singpolyma

@Paul – Thanks for the observation!

@yash – You might try some code like this in your <head> section:

<style type="text/css">
.comment-body {
color:white;
}
</style>

@Spicy – I am unable to reproduce your problem. I go to your website and it works just fine.

@-L- – You might try finding the code in your template for the link that opens/closes the peek-a-boo comments and adding this code just after:

<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'>Post a Comment</a>
</b:if>

Anonymous

hi, thanks! this was of great help.

but i ran into a similar problem like spicy pants.

http://ilkeryoldas.blogspot.com/index.html

i would like to show the comments within the post box and moving the script before "p class="post-footer-line post-footer-line-3"/p" does not work!

what to do?

(if it is necessary, i can email you my full template as well)

Anonymous

Guess who? I'm back!

First of thanks for taking to time to check my blog. It must be my computer. I have been having all sorts of issues.

Secondly, I am having a major problem and I don't know where else to turn. Thought I could pick your brain reagrding it.

As of yesterday Blogger will no longer allow me to post pics. I get an error that says, "You must enter at least one image." Whether I try to upload one image or five, I get this error repeatedly.

Any ideas? I have tried asking people in Bloggers help group but haven't gotten any responses to what it could be, or anyone in a similar situation.

Thirdly, 'ilker'- It didn't work for me either.

THANK YOU SING. You have been a huge help to me this past week!

XOXO

Singpolyma

@ilker and spicy – send both of you your template to me and I'll try to get the comments moved up to before the lines for you.

@spicy – Sorry, can't really help you with the images. I can't think why that wouldn't work. As a workaround, you can use allyoucanupload.com until you get it fixed :)

Anonymous

Hi
This text this translated by google. My English is bad. he wanted to know like I can be able the visual styles of the commentaries and the icon to erase commentary that does not leave.

Singpolyma

@srxo – To change styles you'll want to use the CSS classes:

.comment-poster {style}
.comment-body {style}
.comment-timestamp {style}

I might look into getting the delete icon back, but I'm not sure if that's possible or not :)

Anonymous

Hello. Thank you for the hack! I was waiting to update my blog to the new blogger since I didn't know how to do this. I followed your instruction, and it is working wonderfully. I do have one question. Since implementing this hack, my blog seems to open up rather slowly… Considerably slower than yours, and I was wondering if you might have any insight as to why that is. Thank you for your help.

Anonymous

It seems that whenever i have the "older posts" link at the the bottom – if I click that, then if no new page is loaded (IE the older posts just "appear" there) then the PeekaBoo comments thing does not work =(

Anonymous

Since adding this hack, I've noticed that the page has some problems in IE. Specifically, the banner doesn't show all the way, and when you scroll down the page and then back up, most of the banner disappears. I found a thread on blogger groups that said mixing old and new html code can cause problems in IE. Could this be what is happening? It looks and works perfectly in Firefox.

Singpolyma

@kca — no idea where those messages are coming from, but as long as they don't affect user experience, it shouldn't matter :) As per your request — I have a lot of cookie-related requests out there right now. Hopefully I'll get to them in due time :)

@change_and_grow — My blog does not use this yet (I'm on the old Blogger). Yes it's a bit slow. I'm looking into that.

@Ed — debugged this before. It's something I'm looking at fixing more completely, but for now just remove the id=whatever attribute from the code for the previous post link and it should work :)

@-L- — It could be that you have a lot of HTML4 or just broken code in your page (typical for even many of the hacks out there). My hacks strive to be XHTML1.1 compliant (although I don't always quite get there). If your page is invalid (and all Blogger pages are to some extent) this can cause some issues, yes :)

Anonymous

I tried to paste in the javascript for this and it didn't work. Do you copy all the text? I really appreciate the hack, but would love to have the script hosted in my template. Thanks!

Anonymous

@Ghost Dog — You would have to encase the text from the JS include like so:

<script type="text/javascript">
SCRIPT HERE
</script>

BO18

This post is really interesting and I want it to work for me:P
But it doesnt haha

OK, I followed all your steps and pasted everything exactly how you mentioned it.
But it doesnt work:S

Everytime I save the template I get the following message:

XML error message: The element type "b:skin" must be terminated by the matching end-tag "".

What did I do wrong:S

Could you please help?

Thanks!

Singpolyma

@bo18 — That error sounds like it has little to do with this, which I don't understand. That says that your skin in malformed, but this hack doesn't modify your skin! Perhaps email me your template and I'll take a look?

Evolution Minute

Thanks for your page. I also want comments to show underneath the post. I have followed your scripting instructions 3 times with no results.

My blog is http://www.evominute.blogspot.com

Can you offer some specific troubleshooting?

BO18

Thank you for your help, I really appreciate it!

I will send my template to your gmail address, so you can have a look at it.

Again, thank you!

Cheers,
BO18

Singpolyma

To anyone who was having problems:

There was a typo in this post! I finally found it. Your templates should be able to save after applying this hack now ;)

Please try again if you were having trouble :)

Evolution Minute

I just tried your amended script. It worked! Thank you :)

Smoke

I wish I could figure this one out. I'm updating my girl's site, and as with a few others, I can't get the actual comments to show up. I'm slowly mangling my way through the new Blogger system, so if you could point me in the right direction I'd be very thankful.

CHECK IT…..

Smoke

Ahhhhh….I'm an idiot. Left a line out. It works killer…thanks.

the orientalist

Thanks for your hack. I'm a complete html dummie and have been going nuts trying to figure this one out.

One question: I encountered a problem like celebritysmack with the comments loading below the post boarder at the start of the next post. I can't make the solution you gave them work for my blog – can you help?

http://www.shesturningjapanese.blogspot.com

Singpolyma

@mel — your blog is set to have summary feeds. You must be set to full feeds for this hack to work :)

Mel

Oh, finally got that to work! for some reason blogger had it set to summary feeds although on the settings it was showing full. All i did was switch it off, then on again. Worked great. Thank you v much, and great hack!

nypo

I have been trying like mad to use the peek-a-boo functionality on my blog because, at present, i can't even get the number of comments a post has to appear on the main blog page beneath it. i have added a lot of my own styles and stuff to the minima template i think it was.

when i am adding all the code you mention in the correct places i get an error saying that an 'if' has to end with ;. anything you can suggest?

Singpolyma

@nypo – without seeing your template or what you're doing I can't really say much. One thing I know is that some people who have trouble with this hack seem to understand the instructions for the asynchronous version better. You might try that. Otherwise, email me your template I guess and I'll look.

Kazarelth

Hello!
Thanks for this amazing hack! Works like a charm.
I just have one question though. The timestamp and the comment author's name are on continuous lines. Er… I know I don't make myself clear, so here is an example:

Little Dandelion "My tomorrows will shine" [-Comment author's name]
wow, sounds awesome. [-Comment]
2007-03-05 10:59 [-Timestamp]
Michelle [-Comment author's name]
wow! cant blv i missed it :( [-Comment]
2007-03-07 00:19 [-Timestamp]

I want them to be like:

Little Dandelion "My tomorrows will shine"

wow, sounds awesome.
2007-03-05 10:59

Michelle

wow! cant blv i missed it :(
2007-03-07 00:19

Can you suggest a way of doing this, and also making the comments appear in a different colour?

Thank you again for this hack!!!

Stephen Paul Weber

@Kazarelth – I'm not sure I'm entirely understanding you, but it seems you just want more space? If so, just style the comment-poster, comment-body, and comment-timestamp classes appropriately in CSS. If you want to move the fields around, check out the first part of the code in step 3 – that is the template for generating the comments into the webpage :)

Tiffany

I'm having trouble with this code today. It seems like sometimes it will work for me and other days it won't. Is this a blogger issue? Or a code thing? I installed the code a couple months ago (by the way it is great! I love it when it is working!) and it worked great right from the start. But recently it seems to be very tempermental. Some days it will work and some it won't. When the code decides not to work the process bar (I think that's what it's called) on the bottom of the IE browser page it says "Done, but with errors on page." I thought maybe it was just and IE problem, so I downloaded Firefox, but the comments don't come up in there either.

I guess I should clarify a little bit. When I say it doesn't work, what I mean is I click on the comments link and it comes up with:

4 comments:

post a comment (link)

The comments just aren't appearing on the main page. They are still there if I click on the post a comment link, then I can read them there, but that was kind of the whole point of the peek-a-boo feature; being able to read the comments on the same page.

Anyways, if you could help with this I would appreciate it, or at least just confirm that it is an issue with blogger.

Thanks!

Tiffany

Just thought I'd let you know, I uninstalled this hack (not an easy job!), and put in the one for "Asynchronous Peek-a-boo Comments", and that seems to be working. So problem solved!

Thanks!

Sue

Thank you so much for this! I'm having the same "b:skin" problem as above:

XML error message: The element type "b:skin" must be terminated by the matching end-tag "".

Did you find a specific change to make?

Sue

Got it working: I moved up the first coding insert so that it was immediately below

Stephen Paul Weber

Sorry all for not replying sooner — things are hectic here lately. Glad you got it working. I definitely recommend the asynchronous version in all cases :) This one is here more for historical reasons or for those wishing to do more advanced/specific hackery :)

Michelle

hummm.. I'm trying to work in comments with peekaboo. right now I'm using haloscan instead of blogger comments. I'm not sure what to try next since… Should I go back to blogger and then use your code? there is so much about blogger comments I don't like.. but Haloscan isn't perfect either. Ideas?

Stephen Paul Weber

@Michelle — I think I said something to you already — but if not, here it is — this only works with Blogger comments. Haloscan comments are pretty oldschool ;) My hacks for comments are designed to make Blogger comments more worth using.

If you're gonna go third party js-kit beats haloscan any day ;)

jon

I have tried your step multiple time, the first few I would get a red message saying this was not a valid way of writing the code or something like that, and the last time I could save the data and the blog would appear but it was no different, can you help me out?

Anthony

Thanks for the great hack. I installed it to dump all comments below posts on the main page. However pageloads are now exceedingly slow as my site accesses your script remotely for each post. Is there a way to fix this? Can the required scripts be copied to our blogger template?

Thanks again.

Stephen Paul Weber

@Anthony — if you want to paste the scripts into your template, be my guest — this has IS very slow however, which is why I highly recommend using the newer, much faster, asynchronous version :)

Anthony

Thanks. Copied the script to another (less busy) host server. Pageloads are lightning fast now.

Anthony

Oh yeah. Also had to delete a line in the script calling a second script hosted on singpolyma. Your servers are slow as molasses from my location.

Stephen Paul Weber

@Anthony – glad you got it working :) As I said, however, while the Ning servers may be slow (I know that's true) the larger problem is just the way this hack works — I knew it would be slow the moment I wrote it, hence why I no longer reccomend it. The line you removed is known to be the slowest part of the hack, and probably contributed more to the speed increase than anything else :)

knoxfilms

Nice code! Somehow I ended up with a divider line before the comments. How do I get rid of that?

knoxfilms

I spoke too soon, looks like I can no longer add comments, I just get a loading window that never goes away. Thoughts?

Keith Becker

Hello. I must commend you on your stellar hacks and javascripts for blogger. love the peek-a-boo comments! However, just recently I ran into a snag on my blogI am "The Man": Musings of a White American Male (WAM!).

As you can see, the peek-a-boo comments work perfectly fine on the first page. However, when you click the "older posts" link at the bottom of my blog and move on to the next page, the peek-a-boo functionality no longer … functions. Any thoughts? I would REALLY REALLY REALLY appreciate your help! :-)

Keith Becker

Kudos on your fantastic javascripts and hacks for blogging. I particularly love the peek-a-boo option for comments, but recently I ran into somewhat of a snag on my blog, I am "The Man": Musings of a White American Male (WAM!).

As you can see, the peek-a-boo comments work great on the first page. However, click the "older posts" link at the bottom of my blog, and the peek-a-boo functionality no longer … functions, on the archive pages.

Any thoughts? I would REALLY REALLY REALLY appreciate your help! :-)

Alan

The date format that this picks up is: YYYY-MM-DD HH:MM how can I get this to pick up my 'comments' setting from the settings page? Do I have to manually manipulate it with javascript?

How do I change the dateformat of [[DATE]] in this context?

Thanks!

laura

This is just impressive! I've been looking evereywhere on the Blooger site and there is nothing like this! All the templates you can see as an example show the comments on the main page, but when you try on you own new blog, it was impossible… until now!! Congratulations, and thank you very much!

Torsten

Really great work!!>
Thanks a lot, was just what I#m looking for!

sundae

Hi Sing. I landed from google to your blog ~ looking for the hack to make inline comment box on blogger classic. The choice is either to convert my current blog theme to beta [I prefer this but it seems that would be a hard work since I'm dummies at editing hack] or just find the code for what I want.

There's no search box in this blog.. and I wonder if you have any post related to my question. I'll be very happy if you let me know the solution. :)

Umm.. One more thing. Do you have a hack to make expandable / peek a boo post? I've been trying hans' hack ~ super peek a boo post ~ but I failed :S

Huge big thanks for your help. Enjoy your day..

Stephen Paul Weber

@sundae — sorry, but there is no blogger 'beta' — it has been just blogger for over a year. No one codes for the backwards-compatibility hack called blogger classic.

ebow

I am trying to show all comments on the main page of my blog under each post and have tried the steps you give. I am not tech savvy at all, so any help would be great.

Anonymous

I am a total noob. Can anybody explain to me what part of the hack to post in the head section exactly. Step by step instructions of how to do it would be really helpful. Thanks

levian

i tried, but for number 8, i can't seemed to find this code.




when i save it, all my posts are gone. *sweat*
i wanna make it work so badly !!
:(

Stephen Paul Weber

@levian Your template may be different than the one I was modifying – try to find the code that has the same intention as what I tell you to replace :)

craig

When I try this code or your asynchronous version, I get the same results, all of my posts disappear. Any chance of help? Thanks!

Anonymous

so i tried this on my blogger and it worked, but each comment appears twice. any idea what that could be about? anyone? anyone? beuller?

Anonymous

hi Stephen.. thanks for this great hack :) I'm encountering 1 problem though.. I can't seem to get the Author's link to work.. When I had a look at the source codes, it just says .. I guess the undefined part makes it not able to link to whatever URL the comment author typed.. Do you think you can help me debug this? Here's the site that I used your codes on.. http://jennysunphotography.blogspot.com/

Stephen Paul Weber

@Anonymous, it's been awhile, but IIRC the author links never worked on the main page. That was a blogger limitation at the time. I once got around it with a scraper, but that was slow.

Anonymous

thanks for the heads up Stephen.. Looks like blogger has gotta improve their standards if they wanna beat wordpress :) I sure hope they come up with the comment feature with author links and etc for future template editing :D

Mrig

Hi,

I used your help above to show comments on main page rather than clicking on the comments button and open in a new page.

I was succeddful in getting the post comment box on the main page – however, the old comments do not show up on th same page. I need to click on that to show it again.

Please help- what do I have wrong. Thanks.

Krizalis

Hi Stephen..

Just thought you should know.. the site: jscripts.ning.com is currently down or not available according to their site.. so since you have a javascript file which is reference from that domain for this hack.. the comments aren't appearing i believe its due to the domain being down right now.. :)

Anonymous

Thankyou for you post. I collect many useful info from it!

TrongQuy

Great tips! I will try to apply on my blog!
Thanks thousands time^_^

Liberato

hey there, can i send you my template code by email, so you can please apply this code for me?? i tried once, but i got the message "TEMPLATE ERROR: No dictionary named: 'post' in: ['blog']" (without the ") can you help me? Thanks in advance! ;D

Leave a Response