在Microdata中组合单独的Schema.org组织部分

时间:2015-06-10 23:03:16

标签: html5 schema.org 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>

1 个答案:

答案 0 :(得分:0)

对于 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>
相关问题