Reputation: 1139
For some item or product image, Schema.org documentation instructs to add Microdata like so:
<img itemprop="image" src="/some-src.png" alt="teeext" />
But on the platform I am using, the image is output as <a ...><img /></a>
and I have no access to the function that outputs it this way.
Is there some way to wrap that img-tag-containing-anchor-tag to add itemprop="image"
that is read properly and validates?
NOTE: The only other method I've found -- <meta itemprop="image" content="img-url">
-- I also can't do as there is no way for me to get these images dynamic src urls. I've also tried doing it with jQuery in the head, but search engines don't see it.
Upvotes: 2
Views: 959
Reputation: 5839
Google seems to support dynamically-added JSON-LD which may be a possibility for you.
Google can read JSON-LD data even when it is dynamically injected into the page's contents, such as by Javascript code or embedded "widgets".
https://developers.google.com/structured-data/schema-org
Microformats2 should bring the ability to do this by adding a containing element with a certain class. Google doesn't seem to support/acknowledge this in any documentation yet, but this solution may be a possibility at some point in the future.
Upvotes: 1