我也得到了 "警告:schema.org 的微数据不完整." [英] I too get the " Warning: Incomplete microdata with schema.org."

查看:39
本文介绍了我也得到了 "警告:schema.org 的微数据不完整."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据遍布各地,所以我不能保持这种格式:

<h1 itemprop="name"><p itemprop="描述"><div itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="价格">

就像你在下面的代码中看到的那样,页面上的第一件事是类别路径,它必须在优惠模式内,而不是我有属于产品的图像和标题,而不是我有资格数量又属于优惠和很快....所以我添加了:

在页面的开头并在最后关闭它,然后每当我有一个不属于产品架构的元素(例如eligibleQuantity")时,我就会这样做:

{L_901}:<span itemprop="eligibleQuantity">{QTY}</span><br/>

问题是我不知道这是否是正确的方法,也想不出其他方法.我还收到警告:schema.org 的微数据不完整".这是页面的链接:

https://www.pchounds.com/item.php?id=82627#.UTi7kRz_mSp

下面是页面上的一些代码,所以你可以知道我做了什么.谢谢.

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="breadcrumb">{L_041}:<span itemprop="category">{TOPCATSPATH}</span>

......................................................…………………………………………………………………………………………………………………………………………………………………………!-- 如果 B_HASIMAGE --><div class="span3" style="text-align:center"><img class="img-polaroid" itemprop="image"src="{SITEURL}getthumb.php?w={THUMBWIDTH}&fromfile={PIC_URL}" border="0" alt="title" align="center"><br><h1 itemprop="name" style="line-height:24px;">{TITLE}</h1>............................................................……………………<!-- 如果数量大于 1 --><div itemprop="offers" itemscope itemtype="http://schema.org/Offer">{L_901}:<span itemprop="eligibleQuantity">{QTY}</span><br/>

<!-- ENDIF --><!-- 如果 B_HASENDED -->{L_904}<br/><!-- ENDIF --><!-- 如果 ITEM_CONDITION --><b>{L_1036}:</b><span itemprop="itemCondition">{ITEM_CONDITION}</span><br/><!-- ENDIF --><!-- 如果 ITEM_MANUFACTURER --><b>{L_1037}:</b><span itemprop="manufacturer">{ITEM_MANUFACTURER}</span><br/><!-- ENDIF --><!-- 如果 ITEM_MODEL --><b>{L_1038}:</b><span itemprop="mpn">{ITEM_MODEL}</span><br/><!-- ENDIF --><!-- 如果 ITEM_COLOUR --><b>{L_1039}:</b><span itemprop="color">{ITEM_COLOUR}</span><br/><!-- ENDIF --><!-- 如果 ITEM_YEAR --><b>{L_1040}:</b>{ITEM_YEAR}
<!-- ENDIF --></小>

解决方案

offer必须有价格,必须跟在后面根据价格的价值,但不是,并且在应该只有一个时有多个优惠.从 Google 的结构化数据测试工具的当前测试结果来看,有 5 个错误,每个错误都说明价格缺失.

问题似乎是优惠的每个部分都有一个单独的`http://schema.org/Offer' 在开头 - 所以它期望 5 个价格,5 个报价中的每个报价一个.

您需要做的是声明 http://schema.org/Offer' **once**,例如一个额外的`,它在添加所有报价值之前保持打开状态.

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"><div class="面包屑">项目类别:<a href="https://www.pchounds.com/browse.php?id=1">全部</a>><a href="https://www.pchounds.com/browse.php?id=313">电子</a>><a href="https://www.pchounds.com/browse.php?id=857">音频</a>><a href="https://www.pchounds.com/browse.php?id=879">音频组件</a>><a href="https://www.pchounds.com/browse.php?id=899">演讲者</a></span>

<div class="row"><div class="span3" style="text-align:center"><img class="img-polaroid" itemprop="image" src="https://www.pchounds.com/getthumb.php?w=120&fromfile=uploaded/82627/82627.jpg" border="0" alt="title" align="center">

<div class="span5"><h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS 兼容</h1><div><!-- schema.org/Offer 已删除--><em><p><small>立即购买:<span itemprop="price"><b>108.91</b><a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></小></p></em>

<div class="span5"><h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS 兼容</h1><div><!-- 删除了 http://schema.org/Offer --><em><p><small>立即购买:<span itemprop="price"><b>108.91</b><a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></小></p></em>

运费:<b>8.00</b><a href="https://www.pchounds.com/converter.php?AMOUNT=8.00" alt="converter" class="new-window">USD</a><br/><small>结束于:<span id="ending_counter"><span class="errfont">closed</span></span><br/><p>卖家所在地:美国<br/><div><!-- 删除了 http://schema.org/Offer --><b>付款方式:</b><span itemprop="acceptedPaymentMethod">贝宝</span></p>

</小>...

My data is spread all over so I can't keep this format :

<div itemscope itemtype="http://schema.org/Product">
    <h1 itemprop="name">
    <p itemprop="description">
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
             <span itemprop="price">      
    </div>
</div>  

Like you see in the code below the first thing on the page is the category path which has to be inside Offer schema than I have the image and the title which belong to Product than I have eligibleQuantity that again belongs to the Offer and so on.... So I added the :

<div itemscope itemtype="http://schema.org/Product">

In the beginning of the page and closed it at the end and than whenever I had an element that does not belong to the product schema like "eligibleQuantity" for example I would do this:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
      {L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
      </div>

The problem is I don't know if this is the correct way to do it and can't figure another way. I also get the "Warning: Incomplete microdata with schema.org." Here is a link to the page :

https://www.pchounds.com/item.php?id=82627#.UTi7kRz_mSp

and below is some code from the page so you can have an idea what I did. Thank you.

<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="breadcrumb"> {L_041}:<span itemprop="category"> {TOPCATSPATH}</span> </div>

...........................................................................................
!-- IF B_HASIMAGE -->
<div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image"
   src="{SITEURL}getthumb.php?w={THUMBWIDTH}&fromfile={PIC_URL}" border="0" alt="title" align="center"><br>
<h1 itemprop="name" style="line-height:24px;">{TITLE}</h1>...........................................................................................
<!-- IF QTY gt 1 -->
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  {L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
  </div>
  <!-- ENDIF -->
  <!-- IF B_HASENDED -->
  {L_904}<br />
  <!-- ENDIF -->  
  <!-- IF ITEM_CONDITION -->
   <b> {L_1036}:</b> <span itemprop="itemCondition">{ITEM_CONDITION}</span><br /> 
    <!-- ENDIF -->  
   <!-- IF ITEM_MANUFACTURER --> 
  <b> {L_1037}:</b> <span itemprop="manufacturer">{ITEM_MANUFACTURER}</span><br />                      
  <!-- ENDIF -->
  <!-- IF ITEM_MODEL -->
  <b> {L_1038}:</b> <span itemprop="mpn">{ITEM_MODEL}</span><br />
  <!-- ENDIF -->
  <!-- IF ITEM_COLOUR -->
  <b> {L_1039}:</b> <span itemprop="color">{ITEM_COLOUR}</span><br />                                                
  <!-- ENDIF -->
  <!-- IF ITEM_YEAR -->
  <b> {L_1040}:</b> {ITEM_YEAR}<br />
  <!-- ENDIF -->  
   </small>  

解决方案

offer must have a price, <span itemprop="price"> must be followed by the value of the price but is not and there are multiple Offers when there should just be one. Looking at the current test results from Google's structured data testing tool there are 5 errors, each states the price is missing.

The problem seems to be that each part of the offer has a separate `http://schema.org/Offer' at the start - so it is expecting 5 prices, one for each of the 5 offers.

What you need to do is declare http://schema.org/Offer' **once**, for example an extra` which remains open until all offer values are added.

<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
 <div class="breadcrumb"> Item category:<span itemprop="category"> <a href="https://www.pchounds.com/browse.php?id=1">All</a> > <a href="https://www.pchounds.com/browse.php?id=313">Electronics</a> > <a href="https://www.pchounds.com/browse.php?id=857">Audio</a> > <a href="https://www.pchounds.com/browse.php?id=879">Audio Components</a> > <a href="https://www.pchounds.com/browse.php?id=899">Speakers</a></span>    
 </div>
 <div class="row">
   <div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image" src="https://www.pchounds.com/getthumb.php?w=120&fromfile=uploaded/82627/82627.jpg" border="0" alt="title" align="center"><br>
   </div>
  </div>
 </div>
 <div class="span5">
 <h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
 <div><!-- schema.org/Offer removed -->
  <em>
  <p><small>Buy Now:    
  <span itemprop="price"><b>108.91</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></small></p> 
  </em> 
 </div>

<div class="span5">
<h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
 <div> <!-- removed http://schema.org/Offer -->
 <em>
 <p><small>Buy Now:    
 <span itemprop="price"><b>108.91</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></small></p> 
 </em> 
 </div>
 Shipping fee: <b>8.00</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=8.00" alt="converter" class="new-window">USD</a><br />
 <small>Ends within:
 <span id="ending_counter"><span class="errfont">closed</span></span><br />
 <p> Seller location: United States<br />
  <div> <!-- removed http://schema.org/Offer -->
  <b>Payment methods:</b><span itemprop="acceptedPaymentMethod"> PayPal</span> </p>
 </div>
  </small>

... 

</div>

这篇关于我也得到了 &quot;警告:schema.org 的微数据不完整."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆