html – 关于UserComments模式的dtstart警告
发布时间:2020-12-14 19:42:15 所属栏目:资源 来源:网络整理
导读:我有以下代码用于丰富的代码段: 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" cont
我有以下代码用于丰富的代码段:
<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正在发出警告:
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为例,其中包含有关该产品的多个评论. Review和Comment都是CreativeWork的一部分. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |