After adding microdata to a page, I usually go to: to test it out and to make sure there's nothing missing.
I am getting the following error:
"ContactPoint must be attached to a parent with a declared type"
I am not sure what I am missing...?
Sample HTML
<div itemscope itemtype="http://schema.org/Person">
<p>
<span itemprop="description">Webmaster</span>:
<span itemprop="name">Omar</span>
<br/><a itemprop="url" href="https://plus.google.com/+Omar/">Profile</a>
</p>
<p itemscope itemtype="http://schema.org/ContactPoint">
To contact me please email me at
<a itemprop="email" href="mailto:"></a>
<meta itemprop="contactType" content="Webmaster"/>
<meta itemprop="sameAs" content="https://plus.google.com/+OmarJuvera"/>
<meta itemprop="availableLanguage" content="English"/>
<meta itemprop="availableLanguage" content="Spanish"/>
<meta itemprop="availableLanguage" content="Japanese"/>
</p>
</div>
(While Google’s Testing Tool reports this as an error, it’s not an actual error. It should be a warning instead. Your code is valid Microdata and you are correctly using the Schema.org vocabulary.)
You have two top-level items (a Person
and a ContactPoint
), i.e., they are not related in any way.
If you want to say that the ContactPoint
is the contact point for the Person
, then you need a property to connect these two items (the HTML-level nesting is not relevant here).
Looking at the defined properties for Person
, you can find the contactPoint
property, which takes a ContactPoint
as value and is defined as:
A contact point for a person or organization.
So this property is appropriate for your case.
Add the contactPoint
property to the Person
item, referencing the ContactPoint
item:
<div itemscope itemtype="http://schema.org/Person">
…
<p itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint">
…
</p>
</div>