2011-11-23 23 views
4

我試圖在我的xhtml模板中實現schema.org的microData格式。 由於我使用的XHTML模板,我需要添加當使用schema.org標記和和評論在xhtml頁面中不顯示星和聚合評級

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

代替:

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

否則我的模板將不會被解析。我找到了解決辦法here

我的標記看起來是這樣的:

<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> 

http://www.google.com/webmasters/tools/richsnippets測試這個我沒有得到任何星星迴或累計評論數

我在做什麼錯在這裏?

+0

此錯誤現在似乎已被修復 – Mousey

回答

3

是的! 這個問題實際上包括兩個錯誤,一是有人曾指定的div類 「hReview骨料」,這是適當的,當你實現微格式沒有 微觀數據

第二個錯誤是,我誤解schema.org的規範。 這是我最後做:

  <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> 

希望這有助於!!!!!

1

哎結賬如何holidayhq傢伙已經做了這個網址:www.holidayiq.com/destinations/Lonavala-Overview.html

你可以檢查代碼片段有此工具:http://www.google.com/webmasters/tools/richsnippets

和谷歌退出這個關鍵字「lonavala景點」,你會看到相同的片段,他們已經使用微數據生成這段評論的片段,他們已經使用typeof =「v:Review-aggregate」和更多的標籤,看看它,它的好在片段類型的工作中執行評論。