Yas*_*ser 4 microdata schema.org
我已经阅读了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)
请指教。
这是无效的:
<span itemprop="priceCurrency" content="USD">$</span>
<span itemprop="price" content="1000.00">1,000.00</span>
Run Code Online (Sandbox Code Playgroud)
您不能content在每个元素上使用该属性(在 RDFa 中可以,但在微数据中不能)。
你既可以使用的data元素及其value属性,或meta元素,例如:
<meta itemprop="priceCurrency" content="USD" />$
<data itemprop="price" value="1000.00">1,000.00</data>
Run Code Online (Sandbox Code Playgroud)
您可以使用该PriceSpecification类型来提供价格范围。它允许您使用minPrice和maxPrice属性。
您可以将PriceSpecification带有priceSpecification属性的添加到Offer:
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
<!-- minPrice, maxPrice, priceCurrency -->
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6779 次 |
| 最近记录: |