Reputation: 63
I am trying to figure out the best way to use schema / structured data on two types of pages. One is an image gallery and one is a video page.
Here is data that is present on each type of page:
Video page have almost the same information minus:
Individual images in the gallery
Instead, it has the video, video thumbnail and video duration
I'm a novice at using structured data and I'm hoping if I can get to grips with a single type of schema, I'll be able to apply it to other areas of my site like forums, blogs, etc.
Thank you.
Upvotes: 0
Views: 1186
Reputation: 1865
This is a complex question because it involves using multiple types of structured data definitions. Either microdata or rdf are recommended by google. Start with the basics and add in other elements once you have them working. Google's testing tool and the Structured data linter will check them for you.
This generator will help, just remove the photographed by part.
The https://schema.org/ImageGallery schema exists, which will contain one or more images (images use http://schema.org/ImageObjects). Example from photoswipe with the images each including a link to a larger image:
<div itemscope itemtype="http://schema.org/ImageGallery">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="large-image.jpg" itemprop="contentUrl">
<img src="small-image.jpg" itemprop="thumbnail" alt="Image description" />
</a>
<!-- optionally use this method to store image dimensions for PhotoSwipe -->
<meta itemprop="width" content="300">
<meta itemprop="height" content="600">
<figcaption itemprop="caption description">
Long image description
<!-- optionally define copyright -->
<span itemprop="copyrightHolder">Photo: AP</span>
</figcaption>
</figure>
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="large-image.jpg" itemprop="contentUrl">
<img src="small-image.jpg" itemprop="thumbnail" alt="Image description" />
</a>
<figcaption itemprop="caption description">Long image description</figcaption>
</figure>
...
</div>
Each of the following things are properties of ImageObject, so put these in where they are in your code, e.g. for Title of gallery use the property headline
as follows:
<span itemprop="headline">My trip to Paris</span>
Properties of ImageGallery you can use:
comment
line per comment. Individual comments left by viewers of the galleryComplex ones using more Things (more structured data) -
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Joe bloggs</span>
<img src="joebloggs.png" itemprop="image" /> 
<a itemprop="url" href="http://yourwebsite.com/joeblogs.html">View Profile</a>
</span>
Review TextName, picture and profile link of the reviewer
This can be done like the author one above, but using the http://schema.org/Review schema
Upvotes: 1