如何实现面包屑的schema.org标记? [英] How to implement schema.org markup for a breadcrumb?

查看:131
本文介绍了如何实现面包屑的schema.org标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于使用schema.org标记实现面包屑的信息不多。到目前为止,我可以获得两个正式文档-其中一个正在显示

There isn't much info about implementing a breadcrumb using schema.org markup. So far, I could get two official documents -- one showing this:

<div itemscope itemtype="http://schema.org/Property" itemid="http://schema.org/breadcrumb">
   <link itemprop="domain" href="http://schema.org/WebPage"/>
   <link itemprop="range" href="http://schema.org/Text"/>
</div>

另一个显示如下:

<body itemscope itemtype="http://schema.org/WebPage">
  <div itemprop="breadcrumb">
    <a href="category/books.html">Books</a> >
    <a href="category/books-literature.html">Literature & Fiction</a> >
    <a href="category/books-classics">Classics</a>
  </div>
</body>

两个标记是完全不同的。它们对您有意义吗?如果有,我该如何在下面的普通面包屑代码中加上正确的标记?

The two markups are quite different. Do they make any sense to you? If they do, how do I enclose the following plain breadcrumb code with that markup -- the RIGHT WAY?

<body>
  <span id="breadcrumbs">
      <a rel="home" href="http://example.com">
          <span>Noob Archive</span>
      </a> » 
      <span>
          <a href="http://example.com/topic/html/">
              <span>HTML</span>
          </a> » 
          <strong>Best Practices: Markup for Setting up Breadcrumbs on Web Pages</strong>
      </span>
  </span>
</body>

谢谢!

推荐答案

schema.org最终在 schema.org v1.92更新(2014年12月11日发行)。新的面包屑系统是 ItemList 的扩展,称为 BreadcrumbList 。每个 BreadcrumbList 包含多个 ListItem 元素。这样一来,每页可以有多个面包屑痕迹,可以将每个单独的链接分隔为单独的 ListItem ,并且可以为整个面包屑提供包装。

schema.org finally released a new breadcrumb markup system in the schema.org v1.92 update (released 2014-12-11). The new breadcrumb system is an extension of ItemList called BreadcrumbList. Each BreadcrumbList contains multiple ListItem elements. This allows for multiple breadcrumb trails per page, separation of each individual link as a separate ListItem, and provides a wrapper around the entire breadcrumbs. This should satisfy pretty much every use case.

以下是schema.org中的微数据示例:

Here is the Microdata example from schema.org:

<ol itemscope itemtype="http://schema.org/BreadcrumbList">
  <li itemprop="itemListElement" itemscope
      itemtype="http://schema.org/ListItem">
    <a itemprop="item" href="https://example.com/dresses">
    <span itemprop="name">Dresses</span></a>
    <meta itemprop="position" content="1" />
  </li>
› <li itemprop="itemListElement" itemscope
      itemtype="http://schema.org/ListItem">
    <a itemprop="item" href="https://example.com/dresses/real">
    <span itemprop="name">Real Dresses</span></a>
    <meta itemprop="position" content="2" />
  </li>
</ol>

Google最近重新设计的结构化数据测试工具可以正确解析此标记。但是,该工具的重新设计删除了搜索预览,因此很难说Google如何在Google搜索结果中显示带有此标记的面包屑(或者Google是否会完全使用此数据)。 linter.structured-data.org 也可以正确解析此新标记,但是如此处所述,仅显示此预览作为搜索引擎可能显示内容的示例。每个搜索引擎提供商都可以自行决定是否在您的搜索结果页面中将您的页面显示为增强型搜索结果。

Google's recently redesigned Structured Data Testing Tool parses this markup properly. However, the redesign of the tool dropped the search preview, so it's difficult to say how Google will display breadcrumbs with this markup in Google search results (or if Google will use this data at all). The linter.structured-data.org parses this new markup correctly as well, but as mentioned there, "This preview is only shown as a example of what a search engine might display. It is to the discretion of each search engine provider to decide whether your page will be displayed as an enhanced search result or not in their search results pages."

Google网站管理员工具最近添加了跟踪方式很好地索引了您的结构化数据。它不会显示搜索结果中正在使用的结构化数据,但会显示正在哪些页面上建立索引的数据,并显示结构化数据中的任何错误。

Google Webmaster Tools recently added the ability to track how well your structured data is being indexed. It doesn't show which structured data is being used in search results, but it does show what data is being indexed on which pages, and also shows any errors in your structured data.

这篇关于如何实现面包屑的schema.org标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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