我有一个网站,里面有很多使用 Schema.org Offer
类型的优惠。
我可以以某种方式设置我网站上所有报价的货币吗?还是我必须为它们中的每一个设置itemprop="priceCurrency"
?
不可以,无法为微数据属性设置站点范围的默认值。
如果单个网页包含多个Offer
项,则可以使用微数据的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>