【发布时间】:2015-08-23 00:58:38
【问题描述】:
我有一个关于使用结构化标记 (Microdata / Schema.org) 的正确方法的问题,我有一个主要的概览产品,然后在其中有一个具有单独价格和自定义属性的模型列表。
简化示例:
<div class="mainproduct" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<p itemprop="description">Lorem ipsum my description oh yay all hear this.</p>
<div class="modelslist" >
<div class="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model A</h2>
<span itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="£123" />
<span itemscope itemtype="http://schema.org/PriceSpecification">
<span itemprop="price">£123</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
<div class="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model B</h2>
<span itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="£456" />
<span itemscope itemtype="http://schema.org/PriceSpecification">
<span itemprop="price">£456</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
</div>
</div>
第一季度。指定价格然后指定价格规范是否正确?如果没有元价格,Google 结构化数据测试工具会警告“报价”为空。
第二季度。如何指定“thingymabob”显示的自定义数据。我假设它与“additionalProperty”有关,但测试工具抱怨 Google 无法识别 ProductModel 类型的对象的“additionalProperty”。 (虽然它似乎来自http://schema.org/ProductModel)
更新
好的,这里是更新,定价现在都是 tickity-boo,添加 itemprop="model"、itemprop="offers" 和 itemprop="priceSpecification" 都完成了正确的嵌套。
<div class="mainproduct" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<p itemprop="description">Lorem ipsum my description oh yay all hear this.</p>
<div class="modelslist" >
<div class="model" itemprop="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model A</h2>
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="123" />
<meta itemprop="priceCurrency" content="GBP" />
<span itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
£<span itemprop="price">123</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
<div class="model" itemprop="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model B</h2>
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="456" />
<meta itemprop="priceCurrency" content="GBP" />
<span itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
£<span itemprop="price">456</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
</div>
</div>
这就留下了向模型添加额外属性的问题。从http://schema.org/ProductModel 看来,additionalProperty 应该没问题——只是谷歌目前不允许这样做吗?它确实在测试工具中返回此消息:“Google 无法识别 ProductModel 类型的对象的属性 AdditionalProperty。”还有其他方法可以实现吗?
【问题讨论】:
-
仅供参考:已尝试schema.org/PropertyValue">
-
我tried to answer你的第一季度。我认为 Q2 并没有那么密切的关系,以至于它们应该属于同一个问题。你会同意吗?在这种情况下,您可能需要为 Q2 创建一个单独的问题。
-
我想这与我有关,因为我试图解决一种情况,但是是的,我确实认为在编写 Q1 和 Q2 时我可能不应该这样做:)
标签: schema.org microdata