?
This document uses PHP Chinese website manual Release
全局屬性itemtype
指定將用于定義itemprop
數(shù)據(jù)結(jié)構(gòu)中的(項目屬性)的詞匯表的URL 。itemscope
用于設(shè)置數(shù)據(jù)結(jié)構(gòu)中設(shè)置的詞匯itemtype
將處于活動狀態(tài)的范圍。
谷歌和其他主要的搜索引擎支持schema.org詞匯表的結(jié)構(gòu)化數(shù)據(jù)。這個詞匯表定義了一組標(biāo)準(zhǔn)的類型名稱和屬性名稱。例如,MusicEvent
表示音樂會表演,startDate
以及location
指定音樂會關(guān)鍵細(xì)節(jié)的屬性。在這種情況下,MusicEvent
itemtype
,與startDate
和MusicEvent
定義的位置將被itemprop
URL使用。
注意:關(guān)于itemtype
屬性的更多信息可以在http://schema.org/Thing找到
項目類型屬性必須有一個值是一組無序獨特標(biāo)記,其區(qū)分大小寫的,各是一個有效的和絕對的URL,并且所有定義為使用相同的詞匯。該屬性的值必須至少有一個令牌。
項目類型必須全都是適用規(guī)范中定義的類型(如schema.org),并且必須全部定義為使用相同的詞匯表。
itemtype屬性只能在指定了itemscope屬性的元素上指定。
itemid屬性只能在同時指定了itemscope屬性和itemtype屬性的元素上指定。它們只能在具有itemscope屬性的元素上指定,其itemtype屬性指定不支持項目的全局標(biāo)識符的詞匯表,如詞匯表規(guī)范所定義。
全局標(biāo)識符的確切含義由詞匯表的規(guī)范決定。留下這樣的規(guī)范來定義是否允許相同全局標(biāo)識符(無論在同一頁面還是不同頁面上)的多個項目存在,以及該詞匯表的哪些處理規(guī)則是關(guān)于處理多個項目的情況相同的ID。
<div itemscope itemtype="http://schema.org/Product"> <span itemprop="brand">ACME</span> <span itemprop="name">Executive Anvil</span></div>
itemscope | itemtype | schema.org Product |
---|---|---|
itemprop | name | Executive Anvil |
itemprop | brand Thing | |
itemprop | name | ACME |
<div itemscope itemtype="http://schema.org/Product"> <span itemprop="brand">ACME<br></span> <span itemprop="name">Executive Anvil<br></span> <img itemprop="image" src="https://pixabay.com/static/uploads/photo/2015/09/05/18/15/suitcase-924605_960_720.png" width="50" height="50" alt="Executive Anvil logo" /><br> <span itemprop="description">Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height. <br></span> Product #: <span itemprop="mpn">925872<br></span> <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> Rating: <span itemprop="ratingValue">4.4</span> stars, based on <span itemprop="reviewCount">89 </span> reviews </span><p> <span itemprop="offers" itemscope itemtype="http://schema.org/Offer"> Regular price: $179.99<br> <meta itemprop="priceCurrency" content="USD" /> <span itemprop="price">Sale price: $119.99<br></span> (Sale ends <time itemprop="priceValidUntil" datetime="2020-11-05"> 5 November!</time>)<br> Available from: <span itemprop="seller" itemscope itemtype="http://schema.org/Organization"> <span itemprop="name">Executive Objects<br></span> </span> Condition: <link itemprop="itemCondition" href="http://schema.org/UsedCondition"/>Previously owned, in excellent condition<br> <link itemprop="availability" href="http://schema.org/InStock"/>In stock! Order now!</span></div>
itemscope | itemtype | Product (http://schema.org/Product) | |
---|---|---|---|
itemprop | name | Executive Anvil | |
itemprop | image | https://pixabay.com/static/uploads/photo/2015/09/05/18/15/suitcase-924605_960_720.png | |
itemprop | description | Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height. | |
itemprop | mpn | 925872 | |
itemprop | brand Thing | ||
itemprop | name | ACME | |
itemscope | itempropitemtype | aggregateRatingAggregateRating | |
itemprop | ratingValue | 4.4 | |
itemprop | reviewCount | 89 | |
itemprop | offers Offer | http://schema.org/Offer | |
itemprop | priceCurrency | USD | |
itemprop | price | 119.99 | |
itemprop | priceValidUntil | 2020-11-05 | |
itemprop | itemCondition | http://schema.org/UsedCondition | |
itemprop | availability | http://schema.org/InStock | |
itemscope | itempropitemtype | seller Organization | http://schema.org/Organization |
itemprop | name | Executive Objects |
注意:用于從HTML中提取微數(shù)據(jù)結(jié)構(gòu)的便捷工具是Google的結(jié)構(gòu)化數(shù)據(jù)測試工具。試試上面顯示的HTML
規(guī)范 | 狀態(tài) | 評論 |
---|---|---|
物品種類 | 工作組注意事項 - 不再積極發(fā)展 |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |