An Important Update

Dear Followers Of This Blog ...

If you did not use a Blogger / Google account when you Followed this blog, years ago, you are probably not Following now . During the past...

Sunday, March 29, 2015

Replace "No Comments" With A More Friendly Caption

Ever since Blogger improved the comment count caption / link, they have gotten criticism.

They just replaced the vague 0 comment count, that was originally part of the link to the comment form, with a more indicative caption "No Comments" (or whatever language equivalent may apply, on your blog). But they cannot please everybody.
People think I don't want comments, what can I do?
I think the old saying
Don't try to please everybody!
applies here, in spades.

So people ask, periodically, in Blogger Help Forum: Learn More About Blogger, about template customisation.
How do I replace "No Comments" with something more reader friendly?
And the first question needs to be
Are you comfortable with editing the template?
This can be a rather forbidding question, to some blog owners.

If you don't like "No Comments" (or whatever local language variant your blog uses), you can replace the "No comments" caption with any phrase that pleases you. This may be better if your reader population is concentrated around one language - and if you are able to edit the template.

The comments link caption is accessed, in your template, as "post.commentLabelFull". You will want to find
<data:post.commentLabelFull/>:
and replace it with
Dude, hit me with a comment!
Or whatever friendly greeting you have in mind.

You'll currently find the comments link caption, in your template code.
<b:if cond='data:post.commentSource == 1'> <span class='cmt_count_iframe_holder' expr:data-count='data:post.numComments' expr:data-onclick='data:post.addCommentOnclick' expr:data-post-url='data:post.url' expr:data-url='data:post.canonicalUrl'> </span> <b:else/> <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'> <data:post.commentLabelFull/>: </a> </b:if>
And there is your target. Just a simple change is all you need, for most templates.
<b:if cond='data:post.commentSource == 1'> <span class='cmt_count_iframe_holder' expr:data-count='data:post.numComments' expr:data-onclick='data:post.addCommentOnclick' expr:data-post-url='data:post.url' expr:data-url='data:post.canonicalUrl'> </span> <b:else/> <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'> Dude, hit me with a comment! </a> </b:if>
Search diligently! Some templates may have more than one instance of
<data:post.commentLabelFull/>:
As always, I suggest that you backup the template - before and after you make this change.

Just please keep in mind that you will be editing the post template - and the post template is subject to update, by Blogger. If your change causes a problem, you may end up having to reset the post template, and start over.

Dude, hit me with a comment!

Andy said...

A few years back I change mine to "comments so far". Is time for The Real Blogger Status to make a change? :)

KC Bob said...

Thanks Chuck. I do like it better.

Any way to display that message only when there are no comments?

Chuck Croll said...

Andy,

Dude, hit me with a comment! I just got that working, in this blog!!

But thanks for the reminder!!!

Bob,

I'm not seeing any XML differentation. I fear that "No", as opposed to "1", "2", etc, may be within the code where "post.commentLabelFull" is setup.

That said, it's not impossible to check for "No comments" - and only then use the "friendly" caption - but that will be a LOT more work than simplay replacing "<data:post.commentLabelFull/>:" with "Dude, hit me with a comment!" (or whatever you like).

The Admin said...

finally found the right code!! this one worked for me. i changed the "h4" tag to "p" and replaced the line with a google ad instead. :) worked like a gem!

btw, that line appeared three times in the template but replaced only the two with no "a" tag. thanks!

Stefanie said...

Thank you!!! I've been searching a lot until I finally found a solution to the problem!!!!

Happiness Treasures // www.happiness-treasures.blogspot.com

Georges B. Aboutanos said...

Thank you so much, this worked great for me I appreciate it.

Laurent Brillant said...

OK - I am totally not a pro at this. Can someone help me out? I cannot find the data:post.commentlabel etc. in the code. Can you point to the code line to help me out?

Chuck Croll said...

Hi Laurent,

I'll try - but I need to ask some questions - and my answers need to be readable. This will go a lot easier if we discuss this in the forums.

Maliwan -chw said...
This comment has been removed by the author.