I have this snippet in a LocalBusiness
listing (based on this example):
<div itemscope itemtype="http://schema.org/LocalBusiness">
<div itemprop="image" itemscope="" itemtype="http://schema.org/ImageObject">
<img itemprop="contentUrl" src="/images/trouwlocatiefotos/medium/315_24_83_Veranda-005.jpg">
</div>
</div>
But Google's structured data testing tool throws an error:
image
A value for theimage
field is required.
Why is it throwing the error?
Testing the URL directly: https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Fwww.wonderweddings.com%2Fweddingvenues%2F315%2Fbeachclub-sunrise
The markup snippet you posted doesn’t give the quoted error. So your actual markup is probably doing things differently.
It seems that your image
property isn’t nested under the LocalBusiness
item:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<div itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
itemref
involved.So your LocalBusiness
item really doesn’t have an image
property. Instead, the image
property seems to be specified without any parent item (= itemscope
), which is invalid.
Google’s SDTT probably ignores this error and parses the ImageObject
as a top-level item, which is why it’s listed on its own (next to LocalBusiness
and BreadcrumbList
).
If you can’t move the elements to nest them (like in your example snippet), you could make use of Microdata’s itemref
attribute:
<div itemscope itemtype="http://schema.org/LocalBusiness" itemref="business-image"></div>
<div itemprop='image' itemscope itemtype='http://schema.org/ImageObject' id="business-image"></div>