This question was asked millions of times already, so I decided to put up an article and answer this once and for all.
There are several ways to include ratings in reviews.The most common way is to include the rating written out as a number directly in the HTML, like this microformats example:
Rating: <span class="rating">4.5</span>
Also you can refer this link by Google which gives detailed information
on this.
But I'll show you the easiest way to achieve this. Just include the below
code anywhere inside your post or page to display rating for review.
<div>
<span itemscope="itemscope" itemtype="http://data-vocabulary.org/Review">
<span itemprop="itemreviewed">How to Use Ajax in Magento?</span>
Rating: <span itemprop="rating">5</span> out of 5
<span itemprop="reviewer">Vignesh M</span></span>
</div>
Leave the first <span> as it is. In the second <span> tag, You'll find
<span itemprop="itemreviewed">How to Use Ajax in Magento?</span>
It is used to say what we are reviewing or name of the post or product.
In the third line(Which is really important for displaying rating star),
Rating: <span itemprop="rating">5</span> out of 5
Change the 5 inside the <span itemprop="rating"> to corresponding rating of
the review. Then in the next line you'll find,
<span itemprop="reviewer">Vignesh M</span></span>
It is essential to display ratings by specifying the name of the reviewer.
Then save the post and test the link with Google's Structured Data Testing Tool
Thats It!!
There are several ways to include ratings in reviews.The most common way is to include the rating written out as a number directly in the HTML, like this microformats example:
Rating: <span class="rating">4.5</span>
Also you can refer this link by Google which gives detailed information
on this.
But I'll show you the easiest way to achieve this. Just include the below
code anywhere inside your post or page to display rating for review.
<div>
<span itemscope="itemscope" itemtype="http://data-vocabulary.org/Review">
<span itemprop="itemreviewed">How to Use Ajax in Magento?</span>
Rating: <span itemprop="rating">5</span> out of 5
<span itemprop="reviewer">Vignesh M</span></span>
</div>
Leave the first <span> as it is. In the second <span> tag, You'll find
<span itemprop="itemreviewed">How to Use Ajax in Magento?</span>
It is used to say what we are reviewing or name of the post or product.
In the third line(Which is really important for displaying rating star),
Rating: <span itemprop="rating">5</span> out of 5
Change the 5 inside the <span itemprop="rating"> to corresponding rating of
the review. Then in the next line you'll find,
<span itemprop="reviewer">Vignesh M</span></span>
It is essential to display ratings by specifying the name of the reviewer.
Then save the post and test the link with Google's Structured Data Testing Tool
Thats It!!
No comments:
Post a Comment