Mobile app version of vmapp.org
Login or Join
Connie744

: Trouble while linking to a Brand with itemref I'm trying to link a Brand to a Product with the following code: <div itemscope itemtype="http://schema.org/Product" id="p2000"> ... <meta

@Connie744

Posted in: #GoogleRichSnippetsTool #Microdata #RichSnippets #SchemaOrg

I'm trying to link a Brand to a Product with the following code:

<div itemscope itemtype="http://schema.org/Product" id="p2000">
...
<meta itemprop="brand" itemscope itemtype="http://schema.org/Brand" itemref="v1437"/>
...
</div>


The Brand is already defined on the same web page above, inside an independant block:

<h1 itemscope itemtype="http://schema.org/Brand" id="v1437">
<span itemprop="name">MyBrand</span>
<meta itemprop="url" content="http://www.example.com/MyBrand"/>
<meta itemprop="logo" content="http://www.example.com/MyBrand/logo.png"/>
</h1>


The validator can't find the name property inside the linked Brand object



The link between a Brand and a Person seems to be working, but the Person object is not displaying the Brand's name:



I can use the itemref and id attributes on other objects. I can link Offers to Products and Offers to Persons using the same way.

Is this a bug from the validator?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

itemref does not work like that.

You have to add the itemref attribute to the element you want to apply a property to, and this property has to be defined on an element with the matching ID.

So your example should be:

<div itemscope itemtype="http://schema.org/Product" itemref="v1437">
</div>

<h1 itemprop="brand" itemscope itemtype="http://schema.org/Brand" id="v1437">
<span itemprop="name">MyBrand</span>
<link itemprop="url" href="http://www.example.com/MyBrand"/>
<link itemprop="logo" href="http://www.example.com/MyBrand/logo.png"/>
</h1>


(I changed two meta elements to link elements, which is required if the value is a URI.)

10% popularity Vote Up Vote Down


 

@Bryan171

i guess , that you get different Id's: in case of <meta itemprop="brand" itemscope itemtype="http://schema.org/Brand" itemref="v1437"/> is it v1437, in case of <div itemscope itemtype="http://schema.org/Product"></div> it will be p1437: thats why they aren't match and testing tool can't recognize them correctly

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme