2

I am trying to add the schema.org meta tags to my product pages - having offers and ratings etc.

The code below works fine and I'm able to test it google rich snippet tool.

<div itemscope itemtype="http://schema.org/Product">
    <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
       <meta itemprop="ratingValue" content="5">
       <meta itemprop="reviewCount" content="20">
    </div>

    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
       <span itemprop="price">Rs.100</span>
    </div>
</div>

Now I have a video of this product on this page and based on the page layout - it is positioned above the price. So when I insert the videoobject as shown below - the google rich snippet tool throws an error saying

Error: Page contains property "video" which is not part of the schema

This is the shorter version of the full code which gives the error.

   <div itemscope itemtype="http://schema.org/Product">
    <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
       <meta itemprop="ratingValue" content="5">
       <meta itemprop="reviewCount" content="20">
    </div>

    <div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
       <meta itemprop="name" content="Hello World"/>
       <meta itemprop="duration" content="T1M33S" />
       <meta itemprop="thumbnailUrl" content="v2.jpg" />
       <meta itemprop="contentURL" content="www.viddler.com/player/xyz"/>
       <meta itemprop="embedURL" content="http://viddler.com/flash/publisher.swf?key=xyz"/>  
       <meta itemprop="description" content="Hello world"/>
    </div>

    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
       <span itemprop="price">Rs.100</span>
    </div>
</div>

Now if I remove the video object and put it outside the product tag - its valid. But the way my page is structured - the video will appear within the product tag.

I can close the product tag - start the video tag - close the video tag and then open another new product tag - but then it will show as 2 different products.

Any idea how I should go about this.

Thanks

4

3 回答 3

4

http://www.schema.org/Product 没有定义属性video

  • 你可以省略itemprop="video".
    缺点:视频与产品无关。

  • 您可以改用该属性description
    缺点:预期类型是“文本”(但请参阅schema.org 文档中的预期类型与文本)。

  • 您可以使用itemref将标记分成两部分而不创建两个产品,从而将视频从产品项中删除。
    缺点:视频与产品无关。

于 2013-09-20T12:37:26.710 回答
3

以防万一有人像我一样偶然发现这个问题的答案。我不确定自从原始问题得到回答后这是否发生了变化,但这是 2018 年 1 月的最新答案。

根据 schema.org(参见http://schema.org/Product),可以使用 itemprop="subjectOf" 而不是 itemprop="video" 从产品中引用 CreativeWorks(其中 VideoObjects 是其中的一种) . 请参见下面的示例。这应该适用于谷歌的结构化数据测试工具

<div itemscope itemtype="http://schema.org/Product">
  <img itemprop="image" src="dell-30in-lcd.jpg" alt="A Dell UltraSharp monitor" />
  <span itemprop="name">Dell UltraSharp 30" LCD Monitor</span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue">87</span> out of <span itemprop="bestRating">100</span> based on <span itemprop="ratingCount">24</span> user ratings
  </div>
  <span itemprop="offers" itemscope="" itemtype="http://schema.org/Offer" class="price-excluding-tax">
        <meta itemprop="availability" href="http://schema.org/InStock">
        <meta itemprop="itemCondition" content="http://schema.org/NewCondition">
        <span itemprop="priceSpecification" itemscope="" itemtype="http://www.schema.org/PriceSpecification" id="price-excluding-tax-1003">
            <span class="price-currency" itemprop="priceCurrency" content="GBP">£</span> <span class="price" itemprop="price" content="999">999.00</span>
  </span>
  </span>
  <div itemprop="subjectOf" itemscope itemtype="http://schema.org/VideoObject">
    <meta itemprop="duration" content="PT1M7S" />
    <meta itemprop="name" content="Opera® ProSafe Hospital Profiling Bed" />
    <meta itemprop="description" content="The Opera® ProSafe is the flagship bed from the Opera® range. Its extra low height and high nursing height makes the bed an all-in-one bed, eliminating the need to use low profiling and standard profiling beds separately. The Opera® ProSafe accommodates up to a 10” mattress, allowing the bed to be used with deep airflow mattresses and comply with the BS EN 60601-2-52:2010 medical beds standard."
    />
    <meta itemprop="thumbnailUrl" content="https://alpinehc.co.uk/media/import/prosafe-video-thumbnail.png" />
    <meta itemprop="contentURL" content="https://vimeo.com/232354348" />
    <meta itemprop="embedURL" content="https://player.vimeo.com/video/232354348" />
    <meta itemprop="uploadDate" content="2017-09-04T11:37:00+08:00" />
    <meta itemprop="height" content="340" />
    <meta itemprop="width" content="190" />
    <iframe src="https://player.vimeo.com/video/232354348?api=1&amp;player_id=player1&amp;autoplay=1&amp;loop=1" height="240" width="320"></iframe>
  </div>
</div>

于 2018-01-18T15:01:16.513 回答
0

为unor已经说过的内容增加了一个选项。

您可以将您的视频视为一种评论(产品概述)。您甚至可以说(取决于您的实际网页)AggregateRating(您在代码中)+对它的评论+视频都是这个广泛评论的一部分。然后标记可能如下所示:

  <div itemscope itemtype="http://schema.org/Product">
    <div itemprop="review" itemscope itemtype="http://schema.org/Review">
        <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
           <meta itemprop="ratingValue" content="5">
           <meta itemprop="reviewCount" content="20">
        </div>

        <div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">
           <meta itemprop="name" content="Hello World"/>
           <meta itemprop="duration" content="T1M33S" />
           <meta itemprop="thumbnailUrl" content="v2.jpg" />
           <meta itemprop="contentURL" content="www.viddler.com/player/xyz"/>
           <meta itemprop="embedURL" content="http://viddler.com/flash/publisher.swf?key=xyz"/>  
           <meta itemprop="description" content="Hello world"/>
        </div>
    </div>

    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
       <span itemprop="price">Rs.100</span>
    </div>
  </div>
于 2013-09-20T19:41:38.103 回答