2014-01-15 24 views
5

我有一个公司的网页,其上列出了所有本地分支机构。使用schema.org分支与itemref

  • 在页眉上,我定义了一个组织的itemType。
  • 每个LocalBusiness(酒店)都在页面的下方。

对于每家酒店,我尝试使用元标记添加branchOf属性,但Yandex和Google Snippets对于此属性都为空。有没有可能这样做?

<div itemscope itemtype="http://schema.org/Organization" id="schema-organization"> 
<meta itemprop="description" content="blah blah blah" /> 
<a href="/" itemprop="url"> 
    <h1 itemprop="name">The Hotel Chain</h1> 
</a> 

<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> 
    <div itemprop="addressLocality">new york city</div> 
    <meta itemprop="addressRegion" content="NY" /> 
</div> 
</div> 
<!-- snip --> 
<div itemscope itemtype="http://schema.org/Hotel"> 
<meta itemprop="branchOf" itemref="schema-organization" /> 
<h2 itemprop="name">Hotel Location 1</h2> 
<a href="http://maps.google.com/blahblah" itemprop="map">Get directions on Google Maps</a> 

<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> 
    <meta itemprop="latitude" content="40.7450605" /> 
    <meta itemprop="longitude" content="-73.98301879999997" /> 
</div> 

<div class="wrap-address clearfix" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> 
    <ul class="ul-reset"> 
    <li><span itemprop="streetAddress">1234 Some Street</span> (between 3rd Ave &amp; Lexington Ave)</li> 
    <li> 
    <span itemprop="addressLocality">New York City</span>, 
    <span itemprop="addressRegion">NY</span> 
    <span itemprop="postalCode">10016</span> 
    </li> 
    </ul> 
</div> 

<ul> 
    <li><strong>Phone:</strong><span itemprop="telephone">555-555-5555</span></li> 
    <li><strong>Fax:</strong><span itemprop="faxNumber">555-555-5555</span></li> 
</ul> 
<ul> 
    <li> 
    Information:&nbsp; 
    <a href="mailto:[email protected]" itemprop="email">[email protected]</a> 
    </li> 
    <li itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint"> 
    <span itemprop="contactType">Reservations</span>:&nbsp; 
    <a href="mailto:[email protected]" itemprop="email">[email protected]</a> 
    </li> 
    <li itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint"> 
    <span itemprop="contactType">Concierge</span>:&nbsp; 
    <a href="mailto:Concie[email protected]" itemprop="email">[email protected]</a> 
    </li> 
</ul> 
</div> 

回答

3

About itemref

  1. 它必须在元素中指定与itemscope
  2. 它被用于引用其它性质(= itemprop在微数据)

所以这对你来说意味着:

  • 移动itemref到酒店
  • 移动itemprop="branchOf"本组织

小例子:

<div itemprop="branchOf" itemscope itemtype="http://schema.org/Organization" id="schema-organization"> 
<h1 itemprop="name">The Hotel Chain</h1> 
</div> 

<div itemscope itemtype="http://schema.org/Hotel" itemref="schema-organization"> 
<h2 itemprop="name">Hotel Location 1</h2> 
</div> 
+0

组织项目类型不支持branchOf itemprop;它对LocalBusiness来说是独一无二的。 – phenry

+0

@phenry:在我的示例中,“branchOf”不是“组织”项目的属性。这是'Hotel'项目的一个属性,它通过'itemref'添加。 – unor

+0

你有链接到BranchOf文档吗?这看起来是一种将json-ld和微数据结合在同一元素中的有用方式 – Mousey