Pages

Tuesday, January 17, 2012

0

Templates: Is comment author blog admin? An easy test

If you make Blogger templates or template based hacks, this info might interest you. In the comments section, usually in <b:includable id='comments' var='post'>, if one needs to check if the comment author is blog admin, often seen solutions include:
<b:if cond='data:comment.author == &quot;PUT_USERNAME_HERE&quot;'>
and
<b:if cond='data:comment.authorUrl == &quot;http://www.blogger.com/profile/01234CHANGETHIS56789&quot;'>
But the easiest way, and least error prone, is:
<b:if cond='data:comment.authorClass == &quot;blog-author&quot;'>
After realising this, I updated my How to Hightlight author comments in Blogger hack to use this easier method.
Related Posts Plugin for WordPress, Blogger...
See the hack
for this dynamic
views icon: