Thursday, January 17, 2013

Adding Star Ratings in Blogger using Graddit

Many people might be wondering if adding star ratings in their blogs could be possible. Well, the answer is simply "yes". Then the next question "How?" will follow. For those HTML adept individuals, this question may be too easy to implement within a minute but, for those who don't have enough skills and knowledge, this could be certainly difficult to handle.

Blogger, unlike WordPress, is way too complicated to handle and integrate features. No plug-ins with very limited widgets yet, one of the simpliest and easy-to-manage blogging platforms. Plus, it's owned by Google.

Back to where we are, why do we need this so called "Ratings"? Well, it's not that much important but this will definitely adds flavor to your website/blog. This will also determine how your readers likely enjoy your posts.

Below are the steps to add 5-star ratings to your posts:

1. First, you need to grab the code from Choose from the different styles that will suit your taste. In the Platform Tab, choose Blogger.
How to add blogger star rating below post title
2. Then, go to Blogger and change the template's code. But before that, you have to back-up your template first before editing any code lines. To do so, go to Blogger » Template » Back-up/Restore » Download Full Template. After that, go to Edit HTML » Click Expand Widget Templates.

3. Find (Ctrl + F) the code </head> and paste the below code[1] right "above" it for the CSS styles. 

<link type="text/css" rel="stylesheet" href=""/>

4. Find the code <data:post.body/> and copy the code[2] depending on where you want to place the rating. Remember that if you have multiple <data:post.body/> especially when you're using magazine template, you will find several of these codes. Try them out one by one until you get the desired result.

Note #1: If you want to place the rating below post title, write it "above" <data:post.body/> or put it "below" the code if you want to place it at the bottom of the post.

Note #2: If you want to show the ratings "only" in the posts pages and "not" in homepage, change the code:
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div expr:id='"labels_" +' style='display: none; visibility: hidden;'>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<>,</b:loop></b:if></div>Rate this posting: <div expr:id='' class='ffbs_rate'>{[[&#39;&lt;img src=&quot;;/&gt;&#39;, &#39;&lt;img src=&quot;;/&gt;&#39;]]}</div>
<div expr:id='&quot;feedback_&quot; +' class='ffbs_feedback'>{[&quot;Useless&quot;, &quot;Boring&quot;, &quot;Need more details&quot;, &quot;Perfect&quot;]}</div>
<div expr:id='&quot;ffbs_stats_&quot; +' class='ffbs_stats'></div>

<script type='text/javascript' expr:src='&quot;; + + &quot;?id=&quot; + + &quot;&amp;stats=ffbs_stats_&quot; + + &quot;&amp;&amp;feedback=feedback_&quot; + + &quot;&amp;labels=labels_&quot; + + &quot;&amp;info=info-&quot; + + &quot;&amp;info_delay=2&amp;url=&quot; + data:post.url + &quot;&amp;class_star=ffbs_star_fimg&amp;class_star_set=ffbs_star_fimg&amp;class_star_vote=ffbs_star_fimg&amp;average=yes&amp;views=yes&amp;votes=yes&quot;'></script></b:if>

5. That's it! You're done!

example of 5 star rating in blog
Sample star rating in blogger.
source:  Random Stuff Online
Happy Ratings☺