Question

I'm trying to implement schema.org's microData format in my xhtml template. Since I'm using xhtml templates, I needed to add

<div itemprop="reviews" itemscope="itemscope" itemtype="http://schema.org/Review">

instead of:

<div itemprop="reviews" itemscope itemtype="http://schema.org/Review">

otherwise my template wouldn't be parsed. I found the solution here

My markup looks like this:

<div itemscope="itemscope" itemtype="http://schema.org/Place">

                        <div itemprop="aggregateRating" itemscope="itemscope"
                             itemtype="http://schema.org/AggregateRating">
                            <span itemprop="ratingValue">#{company.meanRating}</span> stars -
                            based on <span itemprop="reviewCount">#{company.confirmedReviewCount}</span> reviews
                        </div>

                        <ui:repeat var="review" value="#{company.reverseConfirmedReviews}">

                            <div itemprop="reviews" itemscope="itemscope" itemtype="http://schema.org/Review">
                                <span itemprop="name">Not a happy camper</span> -
                                by <span itemprop="author">#{review.reviewer.firstName}</span>,
                                <div itemprop="reviewRating" itemscope="itemscope" itemtype="http://schema.org/Rating">
                                    <span itemprop="ratingValue">1</span>/
                                    <span itemprop="bestRating">5</span>stars
                                </div>
                                <span itemprop="description">#{review.text} </span>
                            </div>

                        </ui:repeat>
                    </div>

When testing this in http://www.google.com/webmasters/tools/richsnippets I'm not getting any stars back or aggregated review count

What am I doing wrong here?

Was it helpful?

Solution

Yes!! The problem actually consisted of two errors, first somebody had named the div class to "hReview-aggregate" which is appropriate when you implement Microformats not Microdata

The second error was that I misunderstood the specification of schema.org. This is how I end up doing:

           <div class="box bigBox" itemscope="itemscope" itemtype="http://schema.org/LocalBusiness">
               <span itemprop="name">#{viewCompany.name}</span>
                <div class="subLeftColumn" style="margin-top:10px;" itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">        
                    <div class="num">
                        <span class="rating" id="companyRating" itemprop="ratingValue">#{rating}</span>
                    </div>
                    <div>Grade</div>
                    <div class="num">
                         <span class="count" id="companyCount" itemprop="reviewCount">
                              #{confirmedReviewCount}
                         </span>
                    </div>
                </div>
            </div>

Hope this helps!!!!!

OTHER TIPS

hey checkout how holidayhq guys have done it for this url : www.holidayiq.com/destinations/Lonavala-Overview.html

you can check there snippet on this tool : http://www.google.com/webmasters/tools/richsnippets

and google out this keyword "lonavala attractions" and you will see the same snippet, they have used microdata to generate this reviews in snippet, they have used typeof="v:Review-aggregate" and much more tags, have a look at it, its nice implementation of the reviews in snippet kind of work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top