Showing posts with label Comments. Show all posts
Showing posts with label Comments. Show all posts

Tuesday, November 3, 2009

Blogspot Comments Tutorial: Easily Change or Customize "Post a Comment" Text

I'm referring to the "POST A COMMENT" text which allows or prompts (in case of Embedded Comment Form) readers to make a comment on an article. So, if this tiny piece of text is attractive then it'll surely grab the attention of visitors.

Find "POST A COMMENT" Text in HTML


Actually, Blogger uses different data tags to print out messages like this one. So, if you'll go to Layout then Edit HTML and search for "POST A COMMENT", you won't find anything. To find the Blogger data tag which represents "POST A COMMENT", check Expand Widget Templates and find the following line of code:

<h4 id='comment-post-message'><data:postCommentMsg/></h4>

If you can't find the above code then please contact me by writing a comment otherwise continue with the tutorial.

Customize the Code


Now we know our target so we can use only a single CSS definition to customize it and fortunately that definition is already in our code. Go to Edit HTML tab and find the following piece of code:

#comments h4 {
margin:1em 0;
font-weight: bold;
line-height: 1.4em;
text-transform:uppercase;
letter-spacing:.2em;
color: $sidebarcolor;
}


This definition is defining the style of "POST A COMMENT" text. You can modify it by adding and changing the existing parameters. I'll explain the above definition now!

Margin


margin:1em 0; represents the margin (or distance) from top & bottom (currently 1em) and right & left (currently 0). So, you can control the spacing of "POST A COMMENT" text by simply modifying the margin values.

Font Weight


font-weight: bold; is causing our font to appear bold but you can change font-weight: bold; to font-weight: normal; if you don't wish to make it bold.

Line Height


line-height: 1.4em; is just defining the line height of our text but I'd suggest you to delete this property for our case.

Text Transform


text-transform:uppercase; is transforming the text to uppercase. You can change text-transform:uppercase; to text-transform:lowercase; if you want to make "POST A COMMENT" in lowercase or you can replace it with text-transform:none; if you don't want any modification in it and leave it as it is.

Letter Spacing


letter-spacing:.2em; defines the spacing between each alphabet. Increase or decrease the value .2em to see what happens.

Color


color: $sidebarcolor; is defining the color of our text. I'd recommend you to change color: $sidebarcolor; to color: #ffffff;. In this way, you can easily add the hex code of any color in your definition. Currently, I've added ffffff which is the hex code of white color. How to find the hex codes of different colors? You can simply use a free software like ColorPic.

Finally, I've removed a property to suit my taste (line-height) and also added another (font-size) to get better control over "POST A COMMENT" text. Now, the CSS code should look like this:

#comments h4 {
margin:1em 0;
font-weight: bold;
text-transform:uppercase;
letter-spacing:.2em;
color: #ffffff;
font-size:20px;
}

Before You Leave


I've tried to explain this tutorial in the simplest of manner but you can always ask questions or give suggestions for future writings. Your comments are very welcomed!

Friday, July 24, 2009

Blogger Widget: Show Total Posts & Comments

How to Restore Pencil to Edit Posts

You might have noticed that some Blogger blogs have widget installed in the sidebar which displays total posts and comments of that blog. Well, you can also install such a widget in your blog as well. A simple script allows us to show off total posts and comments on our blog.

Steps to Add the Widget!


  1. Go to Layout | Page Elements.
  2. Click Add a Gadget link in your sidebar where you want to add this widget.
  3. When a new window is opened, chose HTML/JavaScript as your widget and add the following code in the Content field.
    <script style="text/javascript">
    function numberOfPosts(json) {
    document.write('Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
    }
    function numberOfComments(json) {
    document.write('Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
    }
    </script>
    <font color="blue"><script src="http://bloggerfaqs.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script>
    <script src="http://bloggerfaqs.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></font>

  4. Save your widget and see the blog.

Widget Customization!


Replace http://bloggerfaqs.blogspot.com/ with your own blog URL. You can change the Posts: and Comments: text to whatever you like for example you can replace Comments: with Total No. of Comments:.

Thursday, May 14, 2009

Blogspot Tip: How to Control Comments in Asian Languages

Block Spam or Unwanted Comments in Blogger

Many of you might have experienced unwanted comments (aka spam) comments on your blogs. Most of times these comments are linked to some other sites which might include porn sites as well. Sometimes such comments also contain hatred and use of offensive language against someone which could really upset your visitors. Fortunately, Blogger offers a powerful way to control and block spam or unwanted comments on your blog. Our goal is to block the bad guys, but at the same time, we must make sure that regular visitors don't get annoyed by our settings.

I Receive Comments in Strange Japanese, Asian or Chinese Characters!


Most commonly, you'll see comments in strange characters rather than English or some other known language. People often complain about getting comments in Chinese or Japanese languages which contain massive links to phishing or maybe porn sites. So, you really need to stop them.

The Solution: Block Such Comments with Comments Settings!


To change comments settings, log in to Blogger and go to Settings and then Comments. This section is all about comments and I'll explain the important settings one by one.

Who Can Comment?


You have to chose which kind of people can comment on your blog. If you have a public blog, make sure you chose the 1st option Anyone - includes Anonymous Users. It will allow anyone to comment on your blog.

Comment Form Placement


If you've post pages enabled then chose Embedded below post which is the most popular option. your comment form will appear at the bottom of post. However, if your blog doesn't allow post pages then chose any other option.

Comment Form Message


This is very useful but normally underrated option. Add some text in this box and then that text will appear right above your comment form on your blog. If the comments on your blog appear only after your manual approval, then you can simply use a message like "Don't worry! Comments will appear shortly."
How to Block Spam or Unwanted Comments

Comment moderation


Here comes the vital option. Chose Always from the options. This way, all the comments on your blog will be visible only after your approval. Whenever someone will comment (except blog author), a message will be displayed on the dashboard and from there you can approve or reject the comments. Blogger has explained the option in detail here.

Show word verification for comments?


This option will prompt the visitor to write a word from an image before posting a comment. I'd recommend to chose No for this option because it is really annoying. If you're getting far too many spam comments, only then turn it on.

Show profile images on comments?


This is a new addition and lets you display the profile images with comments. I've disabled it for my blog because each profile image means more time to load the page.

Final Words


I've tried to explain the important options regarding comments. A blog is popular only if it gets a lot of comments so make sure you work hard to get people interact. If you've any more questions, feel free to comment, thanks.

Saturday, February 28, 2009

Blogspot Tutorial: Add Comment Posting Guidelines in Blogger

This tutorial will explain how you can add some guidelines right above the comment form. These guidelines could be helpful to encourage users to post constructive comments and also stop spamming.


For example, check out this image taken from Smashing Magazine [See Image].

Let's Add Some Guidelines in Blogger


You can also add some text above the comment form in Blogger. To do that, follow these steps:

1- Log in to your Blogger account.

2- Go to Layout then Edit HTML tab.

3- Check Expand Widget Templates, the page will automatically reload.

4- Find the following line of code:

<h4 id='comment-post-message'><data:postCommentMsg/></h4>

5- Place your guidelines right after the above code but make sure you follow some tips given later in this tutorial.

Some Useful Tips!


1- Use polite and kind words in these guidelines.

2- If you've enabled comment moderation (?) then you must mention to users that their comments won't appear immediately.

3- You can also place a warning message to spammers.

4- If you're using more than one line than you must add <br/> tag after every line. This tag will insert a line-break, for example if you've added some lines like:

<h4 id='comment-post-message'><data:postCommentMsg/></h4>

Posting Guidelines:

1- This is the first line.
2- This is the second line.
3- This is the third line.


When you'll view your blog, you'll see this result:

<h4 id='comment-post-message'><data:postCommentMsg/></h4>Posting Guidelines:1- This is the first line.2- This is the second line.3- This is the third line.

So, for correct placement you must add <br/> tags like this:

<h4 id='comment-post-message'><data:postCommentMsg/></h4><br/>

Posting Guidelines:<br/>

1- This is the first line.<br/>
2- This is the second line.<br/>
3- This is the third line.<br/>


I hope that this tutorial would be helpful for you in some way. If you've any suggestion, request or advice, feel free to post a comment, thanks :-)

Monday, January 19, 2009

How to Decorate Blogger Comments

By default, Blogger comments are very simple with a profile picture but I'll tell you a simple way to make your comments look stylish, beautiful & completely customizable.

Remember: Before proceeding, please backup your current template layout. (?)

Find & Change the Default CSS Code for Comments


To do this quick makeover, just go to Layout then Edit HTML section. Find this code there:

/* Comments
----------------------------------------------- */
#comments h4 {
margin:1em 0;
font-weight: bold;
line-height: 1.4em;
text-transform:uppercase;
letter-spacing:.2em;
color: $sidebarcolor;
}

#comments-block {
margin:1em 0 1.5em;
line-height:1.6em;
}
#comments-block .comment-author {
margin:.5em 0;
}
#comments-block .comment-body {
margin:.25em 0 0;
}
#comments-block .comment-footer {
margin:-.25em 0 2em;
line-height: 1.4em;
text-transform:uppercase;
letter-spacing:.1em;
}
#comments-block .comment-body p {
margin:0 0 .75em;
}
.deleted-comment {
font-style:italic;
color:gray;
}


Tip: If you can't find this code then please comment here with your blog address otherwise continue with the tutorial.


Actually, this is the CSS code responsible for the appearance of your comments. So, you need to replace the above code with the following code:

/* Comments
----------------------------------------------- */

.comment-form {
margin-left:.5em;}

.comments {
margin-left:.5em;}

#comments h4 {
margin:1em 0;
font-weight: bold;
line-height: 1.4em;
text-transform:uppercase;
letter-spacing:.2em;
color: $commentheadingcolor;
}

#comments-block {
font-size:13px;
}
#comments-block .comment-author {
color: $commentauthorcolor;
font-size:12px;
background: $commentauthorbackcolor;
padding:4px;
font-weight:bold;
text-decoration:none;
}
#comments-block .comment-author a:link, .comment-author a:visited, .comment-author a:hover {
font-weight:bold;
color: $commentauthorcolor;
border-bottom:solid 1px $authorborderbottom;
padding-bottom:2px;
text-decoration:none;
}

dd{margin:0; border:0; padding:0; padding:0 10px; background: $bodybackcolor; color: $bodytexcolor;}
dd.comment-body{border:solid 2px $bodysidesbordercolor; border-bottom:none; border-top:none;}
dd.comment-body p{border:0; padding:0; margin:0; padding:10px 0;}
dd.comment-footer{border:solid 2px $footerbordercolor; border-top:none; margin-bottom:10px;}

#comments-block .comment-footer {
margin:-.25em 0 2em;
line-height: 1.4em;
text-transform:uppercase;
letter-spacing:.1em;
}

.comment-timestamp{font-size:11px; color: $commentdatecolor;}
.comment-timestamp a:link, .comment-timestamp a:visited {
font-size:11px; color: $commentdatecolor; background:none; width:auto; height:auto;
text-align:left; font-weight:normal;}


.deleted-comment {
font-style:italic;
color:gray;
}


Save the template and see the comments. You'd notice that the comments are now looking really decent and stylish.

Add the Customization Code in CSS


We've changed the default styling for comments after adding the code in previous step but everyone has different taste so let's add some juicy code to the template's HTML. Now, scroll down a little and you'll find this piece of code:

/* Variable definitions
====================


Right after the above code, you need to add the following code:

<Variable name="commentheadingcolor" description="Comments Heading Color" type="color" default="#0B486B" value="#0B486B">
<Variable name="commentauthorcolor" description="Comment Author Color" type="color" default="#53524b" value="#53524b">
<Variable name="commentauthorbackcolor" description="Comment Author Background Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="authorborderbottom" description="Comment Top Border Color" type="color" default="#80a8ba" value="#80a8ba">
<Variable name="bodybackcolor" description="Comment Body Background Color" type="color" default="#f5f8fa" value="#f5f8fa">
<Variable name="bodytexcolor" description="Comment Text Color" type="color" default="#333" value="#333333">
<Variable name="bodysidesbordercolor" description="Comment Sides Border Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="footerbordercolor" description="Comment Bottom Border Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="commentdatecolor" description="Comment Date Color" type="color" default="#999999" value="#999999">


Now, the overall code should look something like this:

/* Variable definitions
====================
<Variable name="commentheadingcolor" description="Comments Heading Color" type="color" default="#0B486B" value="#0B486B">
<Variable name="commentauthorcolor" description="Comment Author Color" type="color" default="#53524b" value="#53524b">
<Variable name="commentauthorbackcolor" description="Comment Author Background Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="authorborderbottom" description="Comment Top Border Color" type="color" default="#80a8ba" value="#80a8ba">
<Variable name="bodybackcolor" description="Comment Body Background Color" type="color" default="#f5f8fa" value="#f5f8fa">
<Variable name="bodytexcolor" description="Comment Text Color" type="color" default="#333" value="#333333">
<Variable name="bodysidesbordercolor" description="Comment Sides Border Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="footerbordercolor" description="Comment Bottom Border Color" type="color" default="#d7e8f0" value="#d7e8f0">
<Variable name="commentdatecolor" description="Comment Date Color" type="color" default="#999999" value="#999999">


Save your template. Now, you can go to the Fonts & Colors section and customize all the colors according to your taste.