2015-10-05 27 views
0

我想標記使用模式的一些內容,但我遇到了我的itemscopes的問題。架構標記:如何暫時「逃離」的itemscope

我有以下標記現在:

<div itemscope itemtype="https://schema.org/medicalClinic"> 
    <div itemprop="availableService" itemscope itemtype="https://schema.org/MedicalProcedure"> 
    <span itemprop="name">First Service Name</span> 
    <span itemprop="description">First Service Description</span> 
    <div itemprop="availableService itemscope itemtype="https://schema.org/MedicalProcedure"> 
     <span itemprop="name">Second Service Name</span> 
     <span itemprop="description">Second Service Description</span> 
    </div><!-- end second service --> 
    <span itemprop="followup">First Service Followup</span> 
    </div><!-- end first service --> 
</div><!-- end MedicalClinic schema --> 

由於內容的結構方式,第二個服務出現在第一個服務容器中。服務爲先Itemprops之前和第二個服務之後出現。

Google's structured data testing tool顯示錯誤,指出一個availableService不是availableService的屬性(顯然不是我反正想)。

我的問題是我怎麼「逃」我的第一個服務的所以我能夠標記我的第二個服務範圍,然後再進入第一服務的範圍是什麼?

回答

2

有這其中涉及與itemscope(無itemtype)和itemref + id添加div一個醜陋的解決方案:

<div itemscope itemtype="http://schema.org/MedicalClinic" itemref="second-service"> 

    <div itemprop="availableService" itemscope itemtype="http://schema.org/MedicalProcedure"> 
    <span itemprop="name">First Service Name</span> 
    <span itemprop="description">First Service Description</span> 

    <div itemscope> 

     <div itemprop="availableService" itemscope itemtype="http://schema.org/MedicalProcedure" id="second-service"> 
     <span itemprop="name">Second Service Name</span> 
     <span itemprop="description">Second Service Description</span> 
     </div><!-- end second service --> 

    </div> <!-- end dummy div --> 

    <span itemprop="followup">First Service Followup</span> 
    </div><!-- end first service --> 

</div><!-- end MedicalClinic schema --> 

說明您使用的標記:

  • 你可能想use HTTP instead of HTTPS Schema.org URIs
  • Schema.org URI是區分大小寫的(例如,它http://schema.org/MedicalClinic,而不是http://schema.org/medicalClinic
  • 你缺少itemprop收盤"
+0

這完美的作品,謝謝。我還修正了一些錯誤,我關注您在使用HTTP URI的建議。非常感激! –