Thursday, January 15, 2009

Adding star ratings to blogspot custom templates in new blogger beta

3 comments

Recently blogger have added star ratings feature to posts , to enable this go to Layout section and click on edit link on Blog post, than check the check box against Show Star Ratings, for this u might need to login in blogger draft

If u r using template provided with blogger , than doing this will work , but if u r using any custom or third party template than u need to add some code for this to work
Go to edit HTML and check the expend widget template
Search for this line of code:
<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>         
Now search for following code:
<b:include name='feedLinks'/> 
Copy the following code and paste after the line mentioned above:
<b:if cond='data:top.showStars'>     
<script src='http://www.google.com/jsapi'  
type='text/javascript'/> 
<script type='text/javascript'> 
google.load(&quot;annotations&quot;, 
&quot;1&quot;); 
function initialize() 
{google.annotations.setApplicationId
(<data:top.blogspotReviews/>);
google.annotations.createAll(); 
google.annotations.fetch(); 
} 
google.setOnLoadCallback(initialize);     
</script>  </b:if>

Now u'll be able to star ratings in ur posts Njoy

For more info read this blog

Comments

3 comments to "Adding star ratings to blogspot custom templates in new blogger beta"

Anonymous said...
4:46 PM

good trick


Kevin said...
10:33 PM

hey I posted this coad, and it works... however not every time. It's my only widget that is on again and off again. Is there any way to make sure it has a higher priority in loading, or is there possibly any statements I can remove to fix this problem? you can see the blog at http://www.mightybuying.com


Raj Lal said...
12:48 AM

Try http://www.addrating.com. They have a great FREE rating widget, I have tried it for http://innovatwwithgadgets.com


Post a Comment

 

Amit jain online by amiT jaiN -Internet tips and tricks Orkut tricks , blogger hacks n tricks , windows tricks, and lots of other tips and hacks