2008-12-29

How To Highlight Author Comments?



When I do post a comment in my own blog, it doesn't look different from other comments. Having seen some people have implemented author comment highlighting on their sites, I wanted to do the same here.

Login to your Dashboard> Layout> Edit Html. Check the Expand Widget Templates Check Box. Copy and paste the code below before the closing b:skin tag

.comment-body-author {
margin:0;
padding:0 0 0 20px;
}
.comment-body-author p {
font-size:100%;
margin:0 0 .2em 0;
color:#CC3300;
text-decoration:bold;
}

Next, search for the following lines of code.
<dl id='comments-block'>
<b:loop values='data:post.comments' var='comment'>
<dt class='comment-author' expr:id='"comment-" data:comment.id'>
<a expr:name='"comment-" data:comment.id'/>
<b:if cond='data:comment.authorUrl'>
<a expr:href='data:comment.authorUrl' rel='nofollow'><data:comment.author/></a>
<b:else/>
<data:comment.author/>
</b:if>
said...
</dt>

Place this code immediately right after it.
<b:if cond='data:comment.author == data:post.author'>
<dd class='comment-body-author'>
<p><data:comment.body/></p>
</dd>
<b:else/>

Then, search for:-
<dd class='comment-body'>
<b:if cond='data:comment.isDeleted'>
<span class='deleted-comment'><data:comment.body/></span>
<b:else/>
<p><data:comment.body/></p>
</b:if>
</dd>

And place the closing b:if tag </b:if> as shown below:-
<dd class='comment-body'>
<b:if cond='data:comment.isDeleted'>
<span class='deleted-comment'><data:comment.body/></span>
<b:else/>
<p><data:comment.body/></p>
</b:if>
</dd>

</b:if>


Save the template and you're done! From now on, it’s a little easier to spot any comments made by me which is in red color.

5 comments:

Anonymous said...

Teman lama... :)

Sade said...

It does not work for my blog! Can you help about it?

Is said...

Leave me with your blog url and I'll look into the matter whenever I'm free :))

Is said...

Leave me with your blog url and I'll look into the matter whenever I'm free :))

Vichsisowath said...

:angry:

Post a Comment

1. Comments posted must be accompanied by names or pseudonyms.
2. Anonymous posting and those containing profanities will be rejected.
3. Comments are moderated due to spam problems. I have to approve the comment before it will show up.

:)) ;)) ;;) :D ;) :p :(( :) :( :X
=(( :-o :-/ :-* :| 8-} :)] :-t b-( :-L