Separate rich snippet scopes for the same item

◇◆丶佛笑我妖孽 提交于 2019-12-01 07:22:52

问题


I am creating rich snippets for my webshop. One of the itemtypes I use is the "Organization" type. The problem with this is that I have specified the Organisation name and the image in the header of my webshop and the address in the footer. In between is the rest of the webshop with all it's products, reviews etc.

When I test my rich snippets with http://www.google.nl/webmasters/tools/richsnippets, I get two separate Organisations instead of one. Is there a way to combine my two scopes to become one Organisation?

Here is the situation I have right now:

<div id="header" itemscope itemtype="http://schema.org/Organization">
    <h1 itemprop="name">Webshopname</h1>
    <img id="logo" itemprop="logo" src="https://webshopurl/img/webshop-logo.png">
</div>

<div class="whole_article" itemscope itemtype="http://schema.org/Product">
    <h1 itemprop="name">Articlename</h1>
</div>

<div id="footer" itemscope itemtype="http://schema.org/Organization">
    <div id="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <div itemprop="streetAddress">Address 12</div>
        <div itemprop="postalCode">Postalcode</div> 
        <div itemprop="addressLocality">Locality</div>
    </div>
</div>

回答1:


Don’t create several items about the same thing on the same page.

You can use the itemref attribute to add properties to an item that are not nested in the same element:

<div id="header" itemscope itemtype="http://schema.org/Organization" itemref="address">
    <h1 itemprop="name">Webshopname</h1>
    <img id="logo" itemprop="logo" src="https://webshopurl/img/webshop-logo.png">
</div>

<div class="whole_article" itemscope itemtype="http://schema.org/Product">
    <h1 itemprop="name">Articlename</h1>
</div>

<div id="footer">
    <div id="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <div itemprop="streetAddress">Address 12</div>
        <div itemprop="postalCode">Postalcode</div> 
        <div itemprop="addressLocality">Locality</div>
    </div>
</div>


来源:https://stackoverflow.com/questions/21385996/separate-rich-snippet-scopes-for-the-same-item

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!