Link `isRelated` schema.org to parent `Product` when not contained in child element

前端 未结 1 1636
我在风中等你
我在风中等你 2021-01-17 04:51

I\'m trying to indicate multiple related products on a product page using schema.org microdata. But the child products are orphaned because they are not contained in the par

相关标签:
1条回答
  • 2021-01-17 05:19

    You don’t use itemref correctly.

    You’d have to specify itemref on the main product instead of the related products:

    <div itemref="product-1 product-2" itemscope itemtype="http://schema.org/Product">
      <span itemprop="name">Product</span>
    </div>
    
    <div id="product-1" itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
      <span itemprop="name">Product 1</span>
    </div>
    
    <div id="product-2" itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
      <span itemprop="name">Product 2</span>
    </div>
    
    0 讨论(0)
提交回复
热议问题