【发布时间】:2019-09-30 17:40:59
【问题描述】:
我们使用BreadcrumbList 提供的示例使用RDFa 格式显示面包屑。当我们将以下示例插入Google's Structured Data Testing Tool 时,我们会收到以下错误。
设置:
- 显示
BreadcrumbList中的所有items。 - 面包屑导航中的最后一个
item以纯文本形式显示。
使用 RDFa 格式时,最后一个 item 的正确格式是什么?
示例代码
<ol vocab="http://schema.org/" typeof="BreadcrumbList">
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="https://example.com/dresses">
<span property="name">Dresses</span></a>
<meta property="position" content="1">
</li>
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="https://example.com/foo-bar">
<span property="name">foo-bar</span></a>
<meta property="position" content="2">
</li>
<li property="itemListElement" typeof="ListItem">
<span property="name">Real Dresses</span>
<meta property="position" content="3">
</li>
</ol>
使用上述代码的最后一项的错误消息:
项目字段的值是必需的。
我们尝试过但未验证的内容
<ol vocab="http://schema.org/" typeof="BreadcrumbList">
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="https://example.com/dresses">
<span property="name">Dresses</span></a>
<meta property="position" content="1">
</li>
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="https://example.com/foo-bar">
<span property="name">foo-bar</span></a>
<meta property="position" content="2">
</li>
<li property="itemListElement" typeof="ListItem">
<div property="item">
<span property="name">Real Dresses</span>
</div>
<meta property="position" content="3">
</li>
</ol>
从上面使用<div property="item"> 时的错误消息:
为 item.id 提供的值必须是有效的 URL。
【问题讨论】:
标签: html schema.org breadcrumbs rdfa