html – 关于UserComments模式的dtstart警告

前端之家收集整理的这篇文章主要介绍了html – 关于UserComments模式的dtstart警告前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下代码用于丰富的代码段:
<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>

根据schema.org/UserComments,这是正确的.但是,Google’s Rich Snippets Testing Tool正在发出警告:

Warning: Missing @R_404_103@ field “dtstart”.

dtstart甚至不是UserComments事件的属性.我应该忽略这个警告(Google的工具是beta)吗?还是我错过了什么?

解决方法

我想我找到答案.正确的HTML代码似乎是这样的:
<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>

每个评论都有自己的itemscope.这意味着你必须在每个注释上重复itemtype =“http://schema.org/Comment”itemscope =“itemscope”itemprop =“comment”.

检查Google’s example for “Products with many offers”后,我得出了这个结论.他们以eBay为例,其中包含有关该产品的多个评论. @L_502_3@和Comment都是CreativeWork的一部分.

原文链接:https://www.f2er.com/html/223891.html

猜你在找的HTML相关文章