2009年4月25日 星期六

How do I reply to comment on Blogger blogs?

If you can read Chinese, there are more detailed instructions on how to add these codes into your Blogger template.

I have seen lots of people who maintain their blogs on Blogger platform wants to know how to reply to comment with a single-click just as WordPress blogs do, so I wrote a slice of code, wish this would help those who want a [Reply to comment] link right after each comment.

For Blogger Layouts:
Log in to Blogger Dashboard, go to Layout - Edit HTML, then check Expand Widget Template.
You can search for this tag <data:commentPostedByMsg/>, add the following codes after it:
<span class='comment-reply'><a expr:href='&quot;https://www.blogger.com/comment.g?blogID=YOUR-BLOG-ID&amp;postID=&quot; + data:post.id + &quot;&amp;isPopup=true&amp;postBody=%40%3C%61%20%68%72%65%66%3D%22%23&quot; + data:comment.anchorName + &quot;%22%3E&quot; + data:comment.author + &quot;%3C%2F%61%3E#form&quot;' onclick='javascript:window.open(this.href, &quot;bloggerPopup&quot;, &quot;toolbar=0,location=0,statusbar=1,menubar=0,scrollbars=yes,width=400,height=450&quot;); return false;'>[Reply to comment]</a></span>
You should replace YOUR-BLOG-ID with your blog ID, it can be found in your Blogger Dashboard URL, for instance, http://www.blogger.com/posts.g?blogID=12345678

Click Save Template, then have a look, you'll find [Reply to comment] after each of your blog comments. Click this link, it will return:
<a href="#c1234567890">Comment Author</a>
Submit your comment, you'll get a link directly to the comment you supposed to reply.

For Blogger Template:
This will be a little complicated.
Place these before </head> in your template code:
<ItemPage><script type="text/javascript">var postId = "<Blogger><$BlogItemNumber$></Blogger>";</script></ItemPage>
Find the place you want to place [Reply to comment] link, for example, after the tag <$I18NCommentAuthorSaid$>, paste these codes:
<span id="reply-<$BlogCommentNumber$>" title="Reply to comment"></span>
<script type="text/javascript">
var commentAuthor = '<$BlogCommentAuthor$>';
var commentAuthor = commentAuthor.replace(/<[^>].*?>/g,"");
var commentAuthor = escape(commentAuthor.replace(/&nbsp;/,""));
document.getElementById("
reply-<$BlogCommentNumber$>").innerHTML = "<a href=\"https://www.blogger.com/comment.g?blogID=YOUR-BLOG-ID&postID=" + postId + "&isPopup=true&postBody=%40%3C%61%20%68%72%65%66%3D%22%23<$BlogCommentAnchorName$>%22%3E" + commentAuthor + "%3C%2F%61%3E#form\" onclick=\"javascript:window.open(this.href, \'bloggerPopup\', \'toolbar=0,location=0,statusbar=1,menubar=0,scrollbars=yes,width=400,height=450\'); return false;\">[Reply to comment]</a>";
</script>
Save Template.

I hope all of you could like this trick. If you have any further problems or doubts, please leave them and your blog url in comments, thank you all.
本站原创内容遵循署名-非商业性使用 2.5 中国大陆协议

40 条评论:

小毅 说... 回复 / Reply

就是你那篇快速回复的翻译版吧。呵呵

doggie 说... 回复 / Reply

呵呵,英语不错

Marcher 说... 回复 / Reply

@小毅: 嗯,有人需要,我就翻译。
@doggie:XD……

小毅 说... 回复 / Reply

问一个问题啊:你的页面上的友情链接部分都新开窗口,而页面内的链接则是在原来的上打开,这个新开是通过什么实现的啊。

eleven 说... 回复 / Reply

@小毅: 超链接标签里面加个target=_blank就可以了。

Marcher 说... 回复 / Reply

@小毅: 11哥说得对,你就在Link模块里找到那段b:loop,把li标签里的a href中间加上target="_blank"就成了。

小毅 说... 回复 / Reply

@Marcher:
谢谢,同时也谢谢11.我也知道加blank,就是不知道往哪加。呵呵

匿名 说... 回复 / Reply

@Marcher:test view

AcerMore 说... 回复 / Reply

@??:

Thank you. This works great. I "StumbledUpon" it for you.

http://censorshipisdictatorship.blogspot.com

Siao麻雀 说... 回复 / Reply

@��:bu ming bai...

Siao麻雀 说... 回复 / Reply

@小毅:=.=

马晨 说... 回复 / Reply

@Siao麻雀: 哪里不清楚呢?

匿名 说... 回复 / Reply

@nice:

சசிகுமார் 说... 回复 / Reply

@小毅:

EGHEGGF

Kyrié 说... 回复 / Reply

Thank you, I have been wishing for this option for a while.
http://kayessblog.blogspot.com/

匿名 说... 回复 / Reply

@小毅:muy bueno esto

Lalipourie 说... 回复 / Reply

i did instructions for layout and it didn't work! http://lalipourie.blogspot.com/2010/03/macro-fest-fashion-show.html

choonhong 说... 回复 / Reply

@Lalipourie: testing the effect.

MetalElf0 说... 回复 / Reply

Worked like a charm! Thank you!

Vivek Jain 说... 回复 / Reply

vivj2000.blogspot.com

Kerri-Mommy 4 Him 说... 回复 / Reply

I did try this....and the [reply to comment] shows, but when I go to reply it gives me an Error 404....how do I fix this??

mommyoffive4him.blogspot.com

Wanda 说... 回复 / Reply

This is excellent. I put it up on my blog nosmokenopressure.blogspot.com/ and it worked instantly!

匿名 说... 回复 / Reply

@eleven:test 123

匿名 说... 回复 / Reply

@சசிகுமார்:asdddd

نينو 说... 回复 / Reply

@Kerri-Mommy 4 Him:thanks

نينو 说... 回复 / Reply

@نينو:

马晨 说... 回复 / Reply

@Kyrié, @MetalElf0, @Wanda and @نينو, thank you all for visiting my blog :D

Hui Min 说... 回复 / Reply

don't understand, I tried very hard, but ended up fail~ :(

masturah idrus 说... 回复 / Reply

thanx for that info!

马晨 说... 回复 / Reply

@Hui Min: Tell me what's happened. My email is at the bottom of the page.

Hayu Nur Mahron / BlazeHack 说... 回复 / Reply

@马晨:

oh yeah !

Beth 说... 回复 / Reply

Mmmmm . . . I think this worked on both of my blogs (http://smalltravelsandmusings.blogspot.com and http://bethscraftythings.blogspot.com). I do have a couple of questions though.

When someone leaves a reply to the comment, will they know to leave the a href tag that shows up in the comment box so that it shows the comment is a reply? Or will it be a reply no matter what?

And will the person you're replying too get a copy of the reply so they know that you've replied?

Thanks!

马晨 说... 回复 / Reply

@Beth: You may tell your reader not to delete the a href tag in the reply field, because the tag will generate a pointer to the comment he is replying.
What's more, the replying tag is only a "pointer", it can not notify anyone that a comment is being replied. So, let your readers to check the email notification option underneath the reply field.

匿名 说... 回复 / Reply

@Beth:that's not work, what's problem?

马晨 说... 回复 / Reply

@Anonymous: @Beth did input a wrong BLOG-ID number... the correct one should be 5253592763634895016.

Katie and Steph 说... 回复 / Reply

Hi i want to do this real bad. i am using blogger template. when i paste everything, and try to save, i get an error says we cannot save your template, Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.

also i searched for WHERE To paste the script, but the example you gave, CommentsAuthorSaid, doesn't exist in my template html. my website is www.keepmecurly.com

i really need to reply to comments please help me.

马晨 说... 回复 / Reply

@Katie and Steph: Hi, I noticed that you're using Blogger LAYOUT, not the old TEMPLATE. So you should choose the LAYOUT code I provided in the post.
You could just follow the steps: check the "Expand Widget Template" option, find the label, insert the code. I believe you could do it :)
If you have any trouble, feel free to email me, blog@thisischen.com.

Julie Kieras 说... 回复 / Reply

I couldn't get this to work for my blog either - I thought I was using the Layout since I couldn't find any of the code for the template. http://ayearwithmomanddad.blogspot.com
Can you help me figure out what I did wrong? Thanks!

Nerzhul 说... 回复 / Reply

it work. thanx.

马晨 说... 回复 / Reply

@Nerzhul: Good job :D

发表评论

禁止任何商业宣传,请勿放置无关链接
评论可能需要审核,非常感谢您的耐心。
若以下评论表单没有显示,请点此发表评论