【问题标题】:Setting general Schema.org offer currency value with Microdata使用 Microdata 设置通用 Schema.org 提供货币价值
【发布时间】:2016-05-26 07:55:46
【问题描述】:

我的网站有很多使用 Schema.org Offer 类型的优惠。

我能否以某种方式设置我网站上所有报价的货币?或者我必须为每个报价设置itemprop="priceCurrency"

【问题讨论】:

    标签: schema.org microdata


    【解决方案1】:

    不,无法为微数据属性设置站点范围的默认值。

    如果一个页面包含多个 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>
    

    【讨论】:

    • 谢谢!很好的答案!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-18
    相关资源
    最近更新 更多