在微数据中合并单独的 Schema.org 组织部分

Combining seperate Schema.org Organization sections in Microdata

我似乎想不出将徽标部分、地址部分和社交媒体合并到一个架构组织部分的正确方法。

以下代码试图使用 itemref 属性来组合三个独立的区域。

<div itemscope itemtype="http://schema.org/Organization" itemref="schemabiz schemabiz2" >
    <a itemprop="url" href="www.address.com">
        <div itemprop=" legalName"><strong>Business Name</strong></div>
    </a>
    <a itemprop="url" href="http://www.website.com">Home</a>
    <img itemprop="logo" src="logo.png" />
</div>

<!-- Some content -->

<div id="schemabiz">
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <span itemprop="streetAddress">Address</span>
        <span itemprop="addressLocality">City</span>
        <span itemprop="addressRegion">CO</span>
        <span itemprop="postalCode">80525</span>
        <span itemprop="addressCountry">United States</span>
    </div>
</div>

<!-- Some content -->

<div id="schemabiz2" itemscope itemtype="http://schema.org/Organization">
  <a itemprop="sameAs" href="http://www.facebook.com/your-company">FB</a>
  <a itemprop="sameAs" href="http://www.twitter.com/YourCompany">Twitter</a>
</div>

对于 schemabiz

它是这样工作的。

但您也可以省略外部 div 并将 id 添加到 PostalAddress 项。

所以不用

<div id="schemabiz">
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    </div>
</div>

你可以使用

<div id="schemabiz" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
</div>

对于 schemabiz2

不要对引用的元素使用 itemscope+itemtype

所以

<div id="schemabiz2" itemscope itemtype="http://schema.org/Organization">
</div>

你应该使用

<div id="schemabiz2">
</div>