Blogger Widgets
ulesson blog
ulesson blog
Prev 1 2 3 Next

Thursday, May 17, 2012

How To Ratings to your Blog


Star ratings is a new feature currently available through Blogger in Draft. This enables you to add a widget beneath your posts which readers can use to rate your articles on a scale of 1-5, like this:
  1. Go to the Edit HTML page in your blog's dashboard, and ensure you have checked the "expand widget templates" box.
  2. Using your browser's search function, try to find this line of code:

<div class='post-footer-line post-footer-line-1'>

If you cannot locate this, search for the following instead:

<p><data:post.body /></p>

Immediately after this line (either the post-footer or post.body), add the following section of code:

<b:if cond='data:blog.pageType == "item"'>



<span class='star-ratings'>

<b:if cond='data:top.showStars'>

<div expr:g:background-color='data:backgroundColor' expr:g:text-color='data:textColor' expr:g:url='data:post.absoluteUrl' g:height='42' g:type='RatingPanel' g:width='180'/>

</b:if>

</span>



</b:if>

Next, find this line in your Blogger template (this should be a little further down):

<b:include name='nextprev'/>

Just after this line, paste the following section of code:

<b:if cond='data:top.showStars'>

<script src='http://www.google.com/jsapi' type='text/javascript'/>

<script type='text/javascript'>

google.load("annotations", "1");

function initialize() {

google.annotations.createAll();

google.annotations.fetch();

}

google.setOnLoadCallback(initialize);

</script>

</b:if>

Then save your template.

No comments:

Post a Comment