gpt4 book ai didi

microdata - schema.org - 将视频对象嵌套在产品中

转载 作者:行者123 更新时间:2023-12-02 15:35:12 24 4
gpt4 key购买 nike

我正在尝试将 schema.org 元标记添加到我的产品页面 - 提供优惠和评级等。

下面的代码工作正常,我可以用 google rich snippet 工具对其进行测试。

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

现在我在这个页面上有这个产品的视频,并且基于页面布局 - 它位于价格上方。因此,当我如下所示插入视频对象时 - 谷歌丰富网页摘要工具会抛出一条错误消息,指出

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>

现在,如果我删除视频对象并将其放在产品标签之外 - 它有效。但我的页面结构方式 - 视频将出现在产品标签中。

我可以关闭产品标签 - 启动视频标签 - 关闭视频标签然后打开另一个新产品标签 - 但它会显示为 2 个不同的产品。

知道我应该怎么做。

谢谢

最佳答案

http://www.schema.org/Product doesn’t定义属性 video

  • 您可以省略 itemprop="video"
    缺点:视频与产品没有关联。

  • 您可以使用属性 description相反。
    缺点:预期的类型是“文本”(但请参阅 schema.org 文档中的 Expected types vs text)。

  • 你可以使用 itemref将您的标记分成两部分而不创建两个产品,将视频留在产品项目之外。
    缺点:视频与产品没有关联。

关于microdata - schema.org - 将视频对象嵌套在产品中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18886947/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com