【问题标题】:Structured markup adding models to product data将模型添加到产品数据的结构化标记
【发布时间】: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


【解决方案1】:

很遗憾,谷歌搜索(according to their documentation)只支持price,不支持priceSpecification。我相信他们将来会支持它(如果还没有的话,尽管没有记录)。

提供这两个属性似乎是一个合适的解决方案,尤其是在您没有 e.g., a monthly fee 的简单情况下。

关于您的价格标记:

所以你的标记可能看起来像:

<span 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>

(请注意,您还应该使用属性从它所属的产品中引用此Offer。)

【讨论】:

  • 感谢您抽出宝贵时间。实际上,我完成 itemscope itemtype="schema.org/PriceSpecification" 的方式显然通过了谷歌测试,但价格规格似乎与结果中的型号无关。将尝试您的 UnitPriceSpecification 方法。你对货币符号是正确的,所以我会改变它。所以这确实留下了两个棘手的部分
  • 实际上你关于 itemprop="priceSpecification" 的观点让我意识到我在其他地方遗漏了很多 itemprop 属性:型号和报价。我认为这也促使我自己回答 2 的写作方向。此外,新一天的快乐和更清晰的头脑使这些事情更容易被发现。
  • 实际上问题 2 仍然有效,但对我来说,这似乎是缺乏 Google 支持,而不是标记问题。
  • @JonHolland:是的,additionalPropertyadded recently,众所周知,Google 需要一些时间来更新他们的结构化数据测试工具。有alternatives for checking Microdata (+ Schema.org)
  • 标记为已接受的答案 - 我想我们之间已经达成了 :)
猜你喜欢
  • 1970-01-01
  • 2021-08-15
  • 1970-01-01
  • 2021-05-29
  • 1970-01-01
  • 2021-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多