我正在将架构添加到我正在构建的联系人页面中。该页有两个物理地址,这是一个办公室,然而,邮寄地址是不一样的。下面是我使用Schema所做的工作:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<ul>
<li>Office: <span itemprop="streetAddress">1234 Anywhere Street</span>
<br/> <span itemprop="addressLocality">Denver</span>, <span itemprop="addressRegion">CO</span> <span itemprop="postalCode">80000</span>
</li>
</ul>
</div>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<ul>
<li>Mailing: Post Office Box <span itemprop="postOfficeBoxNumber">5555</span>
<br/> <span itemprop="addressLocality">Denver</span>, <span itemprop="addressRegion">CO</span> <span itemprop="postalCode">80000</span>
</li>
</ul>
</div>
<div>
<ul>
<li>Phone: <span itemprop="telephone">555-555-5555</span></li>
<li>Fax: <span itemprop="faxNumber">555-555-5555</span></li>
</ul>
</div>
</div> 我的问题:
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">实例在技术上正确吗?<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">正确的方法是什么?
发布于 2013-08-12 20:21:00
从语法的角度来看,这在技术上是正确的。但不幸的是,人们没有机会从这样的标记中了解什么。我宁愿使用一些描述性更强的属性。例如,位置用于物理地址,contactPoint用于邮件地址。所以应该是这样的
<div itemscope itemtype="http://schema.org/LocalBusiness">
<div itemprop="location" itemscope itemtype="http://schema.org/PostalAddress">
<ul>
<li>Office: <span itemprop="streetAddress">1234 Anywhere Street</span>
<br/> <span itemprop="addressLocality">Denver</span>, <span itemprop="addressRegion">CO</span> <span itemprop="postalCode">80000</span>
</li>
</ul>
</div>
<div itemprop="contactPoint" itemscope itemtype="http://schema.org/PostalAddress">
<ul>
<li><span itemprop="contactType">Mailing: Post Office Box</span> <span itemprop="postOfficeBoxNumber">5555</span>
<br/> <span itemprop="addressLocality">Denver</span>, <span itemprop="addressRegion">CO</span> <span itemprop="postalCode">80000</span>
</li>
</ul>
</div>
<div>
<ul>
<li>Phone: <span itemprop="telephone">555-555-5555</span></li>
<li>Fax: <span itemprop="faxNumber">555-555-5555</span></li>
</ul>
</div>
</div> 请注意,我添加了itemprop="contactType“来显式指定接触点的类型。不过,它是一个简单的文本(属性类型),因此您可以使用任何您喜欢的描述。
我们可以为contactPoint使用schema.org/PostalAddress,因为它是http://schema.org/ContactPoint类型的子类型。
https://stackoverflow.com/questions/18179362
复制相似问题