构造面包屑的问题

时间:2014-08-02 00:04:51

标签: seo breadcrumbs microdata

我有以下html来构建我的面包屑:

<ul class="browsePageBC">
   <li class="product-breadcrumb" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/Wanita" itemprop="url" alt="" title="Wanita"><span class="product-breadcrumb-title" itemprop="title">Wanita</span></a><span class="glyphicon glyphicon-chevron-right"></span></li>
   <li class="product-breadcrumb" itemprop="child" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/Wanita/Aksesoris" itemprop="url" alt="" title="Aksesoris"><span class="product-breadcrumb-title" itemprop="title">Aksesoris </span></a></li>
</ul>

当我在结构化数据测试工具上测试时,this is它给了我什么。想知道为什么它没有正确显示/解析孩子?

2 个答案:

答案 0 :(得分:1)

以下示例代码将帮助您声明父属子属性

<div id="breadcrumb">
    <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
        <a rel="home" href="http://www.example.com" itemprop="url">
          <span itemprop="title">Home</span>
        </a> ›
        <span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
            <a href="http://www.example.com/topic/technology/" itemprop="url">
              <span itemprop="title">Technology</span>
            </a> ›
            <span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="http://www.example.com/tag/gadgets/" itemprop="url">
                  <span itemprop="title">Gadgets</span>
                </a> ›
                <span>Sweet Post Title Goes Here</span>
            </span>
        </span>
    </span>
</div>

请告诉我这些代码是否有帮助。

答案 1 :(得分:0)

Google的文档:Rich Snippets – Breadcrumbs

你会在他们的例子中看到你要么

  • 以正确的顺序列出所有条目(不使用child属性)或
  • 使用child属性,在这种情况下,您必须将子项嵌套在父项下。

请注意,每个条目都需要自己的itemscope