使用图像审查计数和评级 - schema.org

时间:2011-11-21 17:13:50

标签: microdata schema.org rich-snippets

我需要一些帮助才能将一些丰富的代码段添加到我的网站

我按照schema.org上的说明http://schema.org/docs/gs.html#advanced_missing插入了评论微数据,使用星级图片进行评分,并使用评论计数文本,但是使用测试工具测试它没有显示任何内容。 Example page where we use the microdata for the reviews

这是我使用的

<div itemprop="reviews" itemscope itemtype="http://schema.org/AggregateRating">
  <A HREF="javascript:an();"><img src="/images/stars/4.5.gif" border=0></a>
  <meta itemprop="ratingValue" content="4.5" /> 
  <meta itemprop="bestRating" content="5" />
  <BR>
  <span class="bottomnavfooter">
    <A HREF="javascript:an();">Read (<span itemprop="ratingCount">70</span>) Reviews</A 
  </span>
</div>

然后我创建了一个静态测试页面并使用Google提供的说明进行了一些更改http://www.google.com/support/webmasters/bin/answer.py?answer=172705(这与我在schema.org上发现的不同!!)但测试仍然只返回产品名称而不是价格或评论。

Here is my test page - 你能不能看看我哪里出错了

非常感谢!!

1 个答案:

答案 0 :(得分:9)

上面的代码段会失败,因为itempropaggregateRating,但未包含在itemscope中。你的最终锚点关闭标记缺少>也没有帮助,但我想当你将代码复制到SO时这只是一个意外。

另一个问题主要是因为schema.org网站上的例子是错误的(我已经提交了一个错误报告)。他们提到itemprop="reviews"而不是itemprop="aggregateRating"。代码看起来应该如下所示:

<div itemscope itemtype="http://schema.org/Offer">
  <span itemprop="name">Ray-Ban 2132 New Wayfarer Sunglasses</span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <a href="javascript:an();"><img src="/images/stars/4.5.gif" border=0></a>
    <meta itemprop="ratingValue" content="4.5" /> 
    <meta itemprop="bestRating" content="5" /> 
    <br />
    <span class="bottomnavfooter">
      <a href="javascript:an();">Read (<span itemprop="ratingCount">70</span>) Reviews</a>
     </span>
  </div>
</div>