: Schema.org type for image galleries on a page I have articles on my site that can contain one or more photo galleries that are related to the article's content. The schema.org/ImageGallery is
I have articles on my site that can contain one or more photo galleries that are related to the article's content. The schema.org/ImageGallery is defined as a "Web page type: Image gallery page" and as such inherits from the schema.org/WebPage type. The gallery opens up in a lightbox without changing pages though.
Is there a more appropriate type for a gallery that is just a feature on a page, related to the larger containing article?
I have seen the bib Collection type but it's low usage (Usage: Between 10 and 100 domains) and fact that it's not in core makes me concerned.
I've seen this related question but their question is more about the images.
More posts by @Candy875
1 Comments
Sorted by latest first Latest Oldest Best
I agree that ImageGallery is not a suitable type for your case.
There are two alternatives to Collection, but they have drawbacks, so I think Collection is the best solution here.
hasPart
The most simple solution would be to use multiple values for the hasPart property:
<article itemscope itemtype="http://schema.org/Article">
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
</article>
Problem: It doesn’t allow you to group the images into sets. So if it’s important for you to convey which gallery the images belong to (in case an article has multiple galleries), this doesn’t work.
ItemList
The ItemList type can be used to group the images (where each gallery is represented by a list).
Problem: You can’t connect the ItemLists to the Article, because the hasPart property expects a CreativeWork as value, but ItemList isn’t one.
(One case where it does work is if the galleries are the primary items described in the article. In that case, you could use the mainEntity property to connect the ItemLists to the Article.)
Collection
Collection is a CreativeWork, so hasPart can be used:
<article itemscope itemtype="http://schema.org/Article">
<div itemprop="hasPart" itemscope itemtype="http://schema.org/Collection">
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
</div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/Collection">
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
<div itemprop="hasPart" itemscope itemtype="http://schema.org/ImageObject"></div>
</div>
</article>
(If needed, you could of course also combine this with ItemList.)
There is no need to be concerned:
For deciding which type to use, ignore the usage statistics.
It’s no problem that a type is part of an extension. It’s just an organizational decision. Everything in an extension is still part of the main namespace (i.e., you can/should use schema.org/Collection instead of bib.schema.org/Collection).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.