I have an item that I am trying to reference from several other items on my page and I am struggling to get this right, hopefully someone can enlighten me. One of several attempts is this:
<div id="daughter">
<span itemprop="name">Mary</span>
</div>
<div itemscope itemtype="http://schema.org/Person">
<span itemprop="name">John</span>
<meta itemprop="children" itemscope itemtype="http://schema.org/Person" itemref="daughter"/>
</div>
<div itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Julie</span>
<meta itemprop="children" itemscope itemtype="http://schema.org/Person" itemref="daughter"/>
</div>
However if I test this with the Google structured data tool, it produces 2 instances (items) of Mary. I guess this is correct as I am adding an itemscope attribute to the meta tag, but it isn't the result I want.
What is the correct way (if any) of creating 1 item of type "Person" (the child) which is referred to by several other items of type "Person" (the parents) using its property "children"?
Finally stumbled upon the answer .. the following code does what I was looking for - incase it helps anyone else.
<div id="daughter" itemprop="children" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Mary</span>
</div>
<div itemscope itemtype="http://schema.org/Person" itemref="daughter">
<span itemprop="name">John</span>
</div>
<div itemscope itemtype="http://schema.org/Person" itemref="daughter">
<span itemprop="name">Julie</span>
</div>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments