【发布时间】:2016-05-26 07:55:46
【问题描述】:
我的网站有很多使用 Schema.org Offer 类型的优惠。
我能否以某种方式设置我网站上所有报价的货币?或者我必须为每个报价设置itemprop="priceCurrency"?
【问题讨论】:
标签: schema.org microdata
我的网站有很多使用 Schema.org Offer 类型的优惠。
我能否以某种方式设置我网站上所有报价的货币?或者我必须为每个报价设置itemprop="priceCurrency"?
【问题讨论】:
标签: schema.org microdata
不,无法为微数据属性设置站点范围的默认值。
如果一个页面包含多个 Offer 项目,您可以使用 Microdata 的 itemref 属性(参见下面的示例)。但这不适用于跨页面。
<head>
<title>A page with two offers</title>
<meta id="site-currency" itemprop="priceCurrency" content="EUR" />
<!-- this 'meta' element can also be part of the 'body' element -->
</head>
<body>
<div itemscope itemtype="http://schema.org/Offer" itemref="site-currency">
</div>
<div itemscope itemtype="http://schema.org/Offer" itemref="site-currency">
</div>
</body>
【讨论】: