2012-10-18 26 views
5

我正在用Schema.org微數據標記一個物業登錄網站。我的網站的層次結構安排如下所示:如何實現schema.org containedIn?

-City 
--Region 
---Postcode 
----Area 

每一種都鏈接到彼此,所有標記後的Place項目類型單個頁面。我想使用containedIn屬性來描述這些不同頁面之間的關係,但找不到如何最好地執行此操作的任何示例。

E.g.一個「區域」頁面上,我要鏈接到「城」的下面,但我不確定這是否是足夠的或正確的:

<meta itemprop="containedIn" content="New York"> 

當然指向搜索引擎的實際城市頁面URL紐約比起給名字更有用嗎?任何人有任何提示或參考?

回答

5

下面是一個如何選擇標記的例子。 schema.org標記非常靈活,所以不僅有一種方法可以實現。

<div itemscope itemtype="http://schema.org/Residence"> 
<span itemprop="name">Property Listing 1</span><br /> 
<a href="http://www.mypropertylisting.com/property1" itemprop="url">Property One</a><br /> 
    <span itemprop="telephone">555-555-5555</span><br /> 
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> 
     <span itemprop="streetAddress">555 N. Anywhere Street</span><br /> 
     <span itemprop="addressLocality">Somewhere</span>, 
     <span itemprop="addressRegion">LA</span> <span itemprop="postalCode">55555</span> 
     <span itemprop="addressCountry">USA</span> 
    </div> 
<div itemprop="containedIn" itemscope itemtype="http://schema.org/Place"> 
<span itemprop="name">Metropolitan Area</span> 
<a href="http://www.mypropertylisting.com/metropolitan1" itemprop="url">LA Metropolitan Area</a> 
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> 
<meta itemprop="latitude" content="34.065174" /> 
<meta itemprop="longitude" content="-118.240585" /> 
</div> 
</div> 
</div> 

您可以驗證這工作正常使用谷歌的結構化數據測試工具 - >http://www.google.com/webmasters/tools/richsnippets

有可能是指定比使用「地理」 itemprop其他位置更好的辦法,但地理座標確保您確定目標位置正確。 通過schema.org網站查看可以使用的其他屬性,然後使用Google結構化數據測試工具來測試您創建的標記。

祝你好運!