架构标记:如何临时 "escape" itemscope
Schema Markup: How to temporarily "escape" itemscope
我想使用 Schema 标记一些内容,但 运行 我的项目范围出现问题。
我现在有以下标记:
<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 -->
由于内容的结构方式,第二个服务出现在第一个服务的容器中间。第一项服务的物品道具出现在第二项服务之前和之后。
Google's structured data testing tool 显示一个错误,指出 availableService 不是 availableService 的 属性(显然这不是我想要的)。
我的问题是 如何 "escape" 我的第一个服务的范围 以便我能够标记我的第二个服务,然后重新输入第一个服务的范围范围?
有一个丑陋的解决方案,它涉及添加一个 div
和一个 itemscope
(没有 itemtype
)和 itemref
+id
:
<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 -->
关于您的标记的注释:
- 你可能想要
- Schema.org URI 区分大小写(例如,它是
http://schema.org/MedicalClinic
,而不是 http://schema.org/medicalClinic
)
- 你错过了
itemprop
的结尾 "
我想使用 Schema 标记一些内容,但 运行 我的项目范围出现问题。
我现在有以下标记:
<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 -->
由于内容的结构方式,第二个服务出现在第一个服务的容器中间。第一项服务的物品道具出现在第二项服务之前和之后。
Google's structured data testing tool 显示一个错误,指出 availableService 不是 availableService 的 属性(显然这不是我想要的)。
我的问题是 如何 "escape" 我的第一个服务的范围 以便我能够标记我的第二个服务,然后重新输入第一个服务的范围范围?
有一个丑陋的解决方案,它涉及添加一个 div
和一个 itemscope
(没有 itemtype
)和 itemref
+id
:
<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 -->
关于您的标记的注释:
- 你可能想要
- Schema.org URI 区分大小写(例如,它是
http://schema.org/MedicalClinic
,而不是http://schema.org/medicalClinic
) - 你错过了
itemprop
的结尾"