2017-07-28 13 views
-2

私は単純な例を試しましたが、Google Structured testing toolを使ってテストするとSiteNavigationElementは機能しません。SiteNavigationElementが機能しません

<div itemscope itemtype="http://schema.org/WebPageElement"> 
    <link itemprop="additionalType" href="http://schema.org/ItemList" /> 
    <meta itemprop="name" content="navigation_menu" /> 
    <ul> 

    <li itemprop="additionalType" itemscope itemtype="http://www.schema.org/SiteNavigationElement"> 
     <span itemprop="itemListElement"> 
     <a href="http://www.example.com/link_1" itemprop="url"> 
      <span itemprop="name">Link 1</span> 
     </a> 
     </span> 
    </li> 

    <li itemprop="additionalType" itemscope itemtype="http://www.schema.org/SiteNavigationElement"> 
     <span itemprop="itemListElement"> 
     <a href="http://www.example.com/link_2" itemprop="url"> 
      <span itemprop="name">Link 2</span> 
     </a> 
     </span> 
    </li> 

    </ul> 
</div> 

答えて

0

additionalTypeプロパティは、(あなたがitemscope + itemtypeを行っている)別のアイテムを作成するために使用すべきではありません。その仕事は、追加の型のURIを提供することです。そのため、URI自体がここの値です。

ナビゲーション内の各リンクにマークを付けると思われます。 SiteNavigationElement(これはcan only be used to mark up the whole navigationなので、それはtypically uselessです)では不可能です。

それはItemListで可能になり、そしてあなたがadditionalTypeとして(私はこれを利用するすべての消費者が期待していない)SiteNavigationElementを提供することができます:

<div itemscope itemtype="http://schema.org/ItemList"> 
    <link itemprop="additionalType" href="http://schema.org/SiteNavigationElement" /> 
    <ul> 
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage"> 
     <a href="/link-1" itemprop="url"><span itemprop="name">Link 1</span></a> 
    </li> 
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/WebPage"> 
     <a href="/link-2" itemprop="url"><span itemprop="name">Link 2</span></a> 
    </li> 
    </ul> 
</div> 
関連する問題