UserComments架构上的dtstart警告 [英] dtstart warning on UserComments schema

查看:90
本文介绍了UserComments架构上的dtstart警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于评论中的丰富代码段,我有以下代码:

 < ul itemscope itemtype =http:// schema .ORG / UserComments> 
< li id =comment-1class =comment>
< p itemprop =commentText> Bla Bla Bla< / p>

根据 schema.org/UserComments ,这是正确的。但是, Google的Rich Snippets测试工具发出警告:


警告:缺少必填字段dtstart。

dtstart 甚至不是UserComments事件的属性。我应该忽略这个警告(Google的工具是测试版)吗?或者我错过了什么?

解决方案

我想我找到了答案。正确的HTML代码似乎是这样的:

 < ul> 
< li id =comment-1itemtype =http://schema.org/Commentitemscope =itemscopeitemprop =comment>
< span itemprop =author>作者1< / span>
< p itemprop =text> Bla Bla Bla< / p>

每条评论都有自己的itemscope。这意味着您必须对每条评论重复 itemtype =http://schema.org/Commentitemscope =itemscopeitemprop =comment



在检查 Google的有很多优惠的产品的例子。他们使用包含有关该产品的多个评论的eBay页面作为示例。 评论评论都是 CreativeWork

I have the following code for rich snippet on comments:

<ul itemscope itemtype="http://schema.org/UserComments">
    <li id="comment-1" class="comment">
        <span itemprop="name" class="author">Author 1</span>
        <p itemprop="commentText">Bla Bla Bla</p>
        <time itemprop="commentTime" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
    </li>

    <li id="comment-2" class="comment">
        <span itemprop="name" class="author">Author 2</span>
        <p itemprop="commentText">yada yada yada</p>
        <time itemprop="commentTime" content="2012-07-30" datetime="2012-07-30T04:44+00:00" title="Jul 30, 2012 4:44">yesterday</time>
    </li>
 </ul>

According to schema.org/UserComments, this is correct. However, Google's Rich Snippets Testing Tool is giving an warning:

Warning: Missing required field "dtstart".

dtstart is not even a property of UserComments event. Should I ignore this warning (Google's tool is beta)? Or am I missing something?

解决方案

I think I found the answer. The correct HTML code seems to be like this:

<ul>
    <li id="comment-1" itemtype="http://schema.org/Comment" itemscope="itemscope" itemprop="comment">
        <span itemprop="author">Author 1</span>
        <p itemprop="text">Bla Bla Bla</p>
        <time itemprop="dateCreated" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
    </li>
 </ul>

Each comment has its own itemscope. It means you have to repeat itemtype="http://schema.org/Comment" itemscope="itemscope" itemprop="comment" on each comment.

I came to this conclusion after checking Google's example for "Products with many offers". They use as example a eBay page that contains multiple reviews about the product. Review and Comment are both part of CreativeWork.

这篇关于UserComments架构上的dtstart警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆