Ratings

Rating Widgets

Rating widgets are a useful way of getting instant feedback from your readers, on the quality of your blog posts, web pages, pictures or what ever content that you want rated. This feature is currently in beta on our site and therefore may be buggy. Please report any issues you have with it to support. We provide two main types of rating…

Star Rating Widget — The star rating gives the reader a scale of 1-5 to rate your content.

Nero Rating Widget — The nero rating gives just 2 options to the reader and would be used like a simple positive/negative scale.

Create a new rating widget

In the account menu on PollDaddy.com choose the ‘Ratings’ option. Here you will see the ‘List Ratings’ page. Click on the ‘Create New Rating’ button to get started.

On the editor page you can enter a name for your rating, for instance if you were going to use this rating for your posts on your blog, you could call this rating ‘Blog Posts’. Rating Type lets you choose between a star or nero type. Rating Style will let you customize the look and feel of your rating widget. You can choose between 5 different star colors in 3 different sizes; choose font styles; text positioning; and also localize all of the text in your rating. You can even create your own image for use by the widget.

rating customization

↑ Table of Contents ↑

Setting a custom image for your rating

You can override the star image for any rating by setting a custom image on the edit rating page. The ratings use just one image for all states of the star. You must create your image in the same dimensions as the size you choose. Small stars are 16px, medium stars are 20px and large stars are 24px. If you look at the image for the red star below you will see how they are laid out.

star-red-sml

The stars above are all in one image. The stars in the left column are used for displaying the rating and the stars in the right column and used for the hover. i.e. when a person moves their mouse over the rating it uses the stars in the right column. You can also use just one column of stars if you do not want to have a hover state. Lets make one with the PollDaddy Icon. The PollDaddy favicon looks like this: pd-ico Now we need to make a full star, a half star and an ‘off’ star all in the one image. The resulting image will be 16px wide and 48px high like this…

star-pd-sml

You must place this image online somewhere as we don’t allow image uploads at the moment. Once you do you can link to it in the custom image URL box in the edit rating screen.

custom image

The resulting rating widget will look like this…

↑ Table of Contents ↑

Installing your rating

Installing your rating widget is reasonably straight forward. If you are inserting it in a WordPress.com post or page you can use our WordPress short code. On the HTML Code page for the rating widget you will get something like this…

<div id="pd_rating_holder_39"></div>
<script language="javascript">
PDRTJS_settings_39 = {
"id" : "39",
"unique_id" : "default",
"title" : "",
"permalink" : ""
}; </script>
<script language="javascript" src="http://i.polldaddy.com/ratings/rating.js"></script>

In the above install code you will notice that there are 4 parameters called id, unique_id, title, and permalink in the settings variable. The above code will work as it is, but to get the full effect please consider adding values to those parameters such as…

  • id
    This is the rating id and should not be edited
  • unique_id (Mandatory)
    This parameter is very important. Lets say you have an online store and you want to use just one rating widget to rate all of the products in your store. The unique id field is the parameter that will distinguish between different products, so in here you could place the product id or something unique to the product you want to rate. Similarly if you wanted to track different ratings of blogs posts you would place something like the blog post id in this value. Ideally you would generate this unique_id in your code. If you don’t put something unique in here all products in your shop would have the same rating. e.g. "unique_id" : "product1229"
  • Title (Optional)
    To help make your reports make more sense you can add a title to the rating. This should be linked to the unique_id above. So using the example of the online store, you could place the title of the product you are rating in here. e.g. "title" : "3G iPhone leather cover"
  • Permalink (Optional)
    Again to help make your reports clear you can place a link to the content you are rating here. Again using the example of the online store you could place a link to that particular product page here. e.g. http://example.com/product.php?id=1229

↑ Table of Contents ↑

WordPress Shortcode

We also have a WordPress.com short code that you can use for the rating widget. On the rating HTML Code page click on the WordPress.com short code tab on the right. The short code looks like this:

[polldaddy rating="39"]

If you want to apply one rating widget across all of your blog posts, you would need to use our standard installation code above. You would place this for instance at the end, or at the top, of the blog post in the single.php file. Here is an example of how you can get WordPress to automatically fill in the parameters to maximize the accuracy of your reports.

<div id="pd_rating_holder_39"></div>
<script language="javascript">
PDRTJS_settings_39 = {
"id" : "39",
"unique_id" : "wp-post-<?php echo( $post->ID ); ?>",
"title" : "<?php echo( $post->post_title ); ?>",
"permalink" : "<?php echo( get_permalink( $post->ID ) ); ?>"
};
</script>
<script language="javascript" src="http://i.polldaddy.com/ratings/rating.js"></script>

↑ Table of Contents ↑

Loading ratings asynchronously

If you you have a number of ratings on a page and would like to load them after the page has loaded then simply add the javascript include to your footer…

<script language="javascript" src="http://i.polldaddy.com/ratings/rating.js"></script>

You would then remove it from any of your rating embed codes. As long as there is one javascript include after all of your rating embeds codes then they will load fine.