1

I created a recipe on Drupal 8. When I test my page with Google Structured Data Testing Tool, it tells me that the image field is missing:

Yet when I open the link of the image in my internet browser, the image is displayed.

Why does the Google tool tell me that the image field is missing?

Example markup:

<img property="schema:image" src="image.jpg" alt="…" typeof="foaf:Image" />
2

The error the SDTT reports is only for getting Google’s Article rich result. If you don’t want to get the rich result, you can ignore the error.

For getting Google’s Article rich result, the value for image needs to be either a URL, or an Schema.org ImageObject.

So you can either remove the FOAF Image type, so that you only provide a URL value:

<img property="schema:image" src="image.jpg" alt="…" />

Or you can provide an Schema.org ImageObject + FOAF Image item:

<div typeof="schema:Article">
  <div property="schema:image" typeof="foaf:Image schema:ImageObject">
    <img property="schema:contentUrl schema:url" src="image.jpg" alt="…" />
  </div>
</div>

(You can ignore the error that Google’s SDTT doesn’t know the FOAF Image type; the tool mostly knows only Schema.org, but it’s perfectly fine to use other vocabularies.)

0

In general: This is a kind of messy code, which comes from the Drupal core and extensions. Don't know, how to deal with it. I would firstly get rid of any extension, which implements structured data. Then i would write a clean structured data code, which reflects my needs. Then i would try to implement it.

Your image: in the test you run the image you are talking about is recognized as an image:

enter image description here

You should clean up you structured data code and tie the meaningful data types (Recipe, Article and Person) to the one single entity together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.