如何使用Schema.org在Google丰富网页摘要中显示单个产品评分

时间:2012-05-05 18:57:36

标签: schema.org rich-snippets

大多数示例都显示了多个评分

我想在Google上显示评分,但我发现的所有评分示例都显示多人投票。

我想显示一位作者评分

我想要的是只展示网站背后的团队所做的一项评分,例如此网址上的屏幕截图:http://wordpress.org/extend/plugins/author-hreview/

到目前为止......

这不是我想要的,但可能是一个开始。

<div itemscope itemtype="http://schema.org/Product">
  <span itemprop="name">Test</span>
  <div itemprop="aggregateRating"
    itemscope itemtype="http://schema.org/AggregateRating">
   Rated <span itemprop="ratingValue">3.5</span>/5
   based on <span itemprop="reviewCount">11</span> customer reviews
  </div>
</div>

接受的答案

2 个答案:

答案 0 :(得分:1)

我找到了它!

<div itemtype="http://schema.org/Review" itemscope="">
    <meta content="admin" itemprop="author" />
    <div itemtype="http://schema.org/Rating" itemscope="" itemprop="reviewRating">
        <meta content="1" itemprop="worstRating" />
        <meta content="3.5" itemprop="ratingValue" />
        <meta content="5" itemprop="bestRating" />
    </div>
</div>

答案 1 :(得分:0)

格式不断变换。最重要的是,搜索引擎已经开始验证评论。我会使用microformats.org hproduct而不是目前(2013)schema.org不允许对产品进行非综合评论

<div id="review">
<div class="hproduct">
<div><a class="url" href="product.html"><span class="fn">Test</span></a></div>
<div class="description pro contra">A short description</div>
<div class="review hreview">
<abbr class="dtreviewed" title="2015-01-01"></abbr>
<abbr class="best" title="5"></abbr>
<abbr class="rating" title="3.5"></abbr>
<abbr class="worst" title="1"></abbr>
<div style="display:inline-block">
<input type="radio" name="total" title="Horrible!" class="star" disabled="disabled" />
<input type="radio" name="total" title="Very Bad!" class="star" disabled="disabled" />
<input type="radio" name="total" title="Not Good" class="star" disabled="disabled" />
<input type="radio" name="total" title="OK" class="star" disabled="disabled" />
<input type="radio" name="total" title="Not Bad" class="star" disabled="disabled" />
<input type="radio" name="total" title="Good" class="star" disabled="disabled" />
<input type="radio" name="total" title="Pretty Good" class="star" disabled="disabled" checked="checked" />
<input type="radio" name="total" title="Very Good" class="star" disabled="disabled" />
<input type="radio" name="total" title="Excellent!" class="star" disabled="disabled" />
<input type="radio" name="total" title="Perfect!" class="star" disabled="disabled" />
</div>
<div style="display:inline-block" class="reviewer vcard">
<span class="fn" itemprop="name">Anonymous</span>
</div>
</div>
</div>