用作参考:https://support.google.com/webmasters/answer/146750?hl = zh-CN
您会在"产品"下注意到有一个类别属性,而且页面下方有一个示例:
<span itemprop="category" content="Hardware > Tools > Anvils">Anvils</span>
Run Code Online (Sandbox Code Playgroud)
我完全模仿了:
<span itemprop="category" content="kitchen sinks > stainless steel sinks > undermount">undermount</span>
Run Code Online (Sandbox Code Playgroud)
然而,当我使用Google的结构化数据工具测试它时,我收到错误:
错误:页面包含属性"类别",它不是架构的一部分.
我在例子中也意识到,它使用的是data-vocabulary.org→Product,我在使用schema.org→Product.
现在在http://schema.org/Product上,它没有提到任何类别.schema.org不提供类别吗?或者我错过了什么?
哪一个是正确的?
<link itemprop="availability" href="http://schema.org/InStock">
?<meta itemprop="availability" content="InStock" />
<span itemprop="availability" content="in_stock"></span>
Run Code Online (Sandbox Code Playgroud)
我查看了官方架构文档,并在示例中找到了所有这些文档.
我想他们所有人都会工作,但目前,有没有首选标准?
我已经阅读了http://schema.org/price(微数据示例),我想在我的其中一个页面上使用。
这是我感兴趣的,我想显示价格/价格范围
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<!--price is 1000, a number, with locale-specific thousands separator
and decimal mark, and the $ character is marked up with the
machine-readable code "USD" -->
<span itemprop="priceCurrency" content="USD">$</span><span
itemprop="price" content="1000.00">1,000.00</span>
<link itemprop="availability" href="http://schema.org/InStock" />In stock
</div>
Run Code Online (Sandbox Code Playgroud)
现在,在页面上选择某些选项之前,我的页面不显示任何价格,但是我确实有一个基本价格(最低),我想在这种情况下使用它。
如何以及在何处注入此基本价格的正确位置?
我在https://search.google.com/structured-data/testing-tool上试过这个,它有效。不确定这是否是正确的方法?
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="USD" />
<meta itemprop="price" content="2.31" />
</div>
Run Code Online (Sandbox Code Playgroud)
请指教。