Question

I know 'primaryImageOfPage' is a property of WebPage. But 'primaryImageOfPage' isn't a property of Article.

For this code:

<html itemscope itemtype="http://schema.org/webpage">
<head>
<meta itemprop="name" content="webpage"/>
</head>

<body>

    <p itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Article">
       <img src"example1.png" itemprop="image"/>
       <img src"example2.png" itemprop="image"/>
       <img src"example3.png" itemprop="image"/>
       <img src"example4.png" itemprop="image"/>
    </p>

</body>

</html>

How can I choice Primaery picture for Article? Dose Article inherits from Webpage? FOr example:

<html itemscope itemtype="http://schema.org/webpage">
<head>
<meta itemprop="name" content="webpage"/>
</head>

<body>

    <p itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Article">
       <img src"example1.png" itemprop="primaryImageOfPage"/>
       <img src"example2.png" itemprop="image"/>
       <img src"example3.png" itemprop="image"/>
       <img src"example4.png" itemprop="image"/>
    </p>

</body>

</html>
Was it helpful?

Solution

Does Article inherit from WebPage?

No. You can’t use primaryImageOfPage for Article.

While it makes sense to specify the main content/image of a WebPage, would it also make sense to specify this for an Article? I’d say that an Article should only contain main content/images in the first place.

If there is an image the whole Article is about, you could use the about property. Example: interpretation of a painting. If this image is from a different source, you could use the citation property in addition.

For images being part of the Article, there is the associatedMedia property. While its description is somewhat confusing, it got discussed that this property could be used for linking images (or other media) that belong to or are part of the Article (currently, it has the synonym encoding, which they planned to remove; I don’t know why that did not happen yet).

Note that I wouldn’t use the image property for all images that are part of the Article. I think this property should only be used for images of the Article itself, i.e., images representing this whole Article. This could be a screenshot of the Article, a thumbnail, maybe a lead picture.

So, you could use associatedMedia for the main image(s) and no property for secondary images:

<article itemscope itemtype="http://schema.org/Article">
  <span itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
    <img itemprop="contentUrl" src"main-image.png" alt="…" />
  </span>
  <img src"secondary-image-1.png" alt="…" />
  <img src"secondary-image-2.png" alt="…" />
  <img src"secondary-image-3.png" alt="…" />
</article>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top