Someone asked Kang Rohman how to create comment box in different background for admin’s comment and visitor’s comment. In order to create comment box in different background (highlighted) for admin’s comment is very easy. You only need to apply a little modification on your blogger template. If you are interested in this tutorial, please read carefully until the end.
Need to remember, the character of every template is often different, whether in the design or the coding. Therefore, Kang Rohman takes a sample of Minima template, the original template provided by Blogger. The following are the steps:
- Login to Blogger with your ID
- Click on Layout
- Click on Edit HTML
- Click on Download Full Template. Please backup your template
- Give a tick in a small box beside the words Expand Widget Templates
- Find the code ]]></b:skin> on your template
- Copy and paste the code below exactly above the code ]]></b:skin>
.comment-admin {
clear: both;
margin: 10px 0 14px 0;
padding: 10px;
width: 400px;
background: #eee;
color:#000;
}
- Scroll down the page and find the code:
<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>
<dd class='comment-footer'>
<span class='comment-timestamp'>
<a expr:href='data:comment.url' title='comment permalink'>
<data:comment.timestamp/></a>
<b:include data='comment' name='commentDeleteIcon'/>
</span>
</dd>
- Add the red-printed code as the code below: (code)
<b:if cond='data:comment.author == data:post.author'>
<dd class='comment-admin'>
<p><data:comment.body/></p>
</dd>
<b:else/>
<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>
<dd class='comment-footer'>
<span class='comment-timestamp'>
<a expr:href='data:comment.url' title='comment permalink'>
<data:comment.timestamp/></a>
<b:include data='comment' name='commentDeleteIcon'/>
</span>
</dd>
</b:if>
- Click Save Template button
- Done
To see the result of your modification, whether it works or not, you can comment on your blog with condition you login first to your blogger account or write your name.
Note: the CSS code above is the basic only, you can show your high creativity by doing the CSS part. For implementation of the code above, you can see the example here or here.
0 komentar:
Posting Komentar