#Rich Snippets
Rich Snippets (Schema.org tags) are defined the same way for both Pages and Layouts and stored in their schemas: []
field. New Schemas will be added over time. Using supported Schemas allows the user to easily edit them for their purposes, though you can use Custom type as a fallback if the Schema you need to use is not yet supported.
Supported Schemas follow the official specs closely, though sometimes plurals are used rather than singulars, for example images
, instead of image
or authors
instead of author
. Some fields also differ slightly for convenience, such as timeRequired
always being in minutes.
For specific information about a field, reference the original spec at Schema.org. For example, for what addressCountry
accepts, look the field up on Schema.org and find addressCountry.
Almost all fields support Templating, which is of course encouraged since you'll probably want to be pulling data from your Addon or Addon's Collections. Comma-separated fields that require Media IDs will accept arrays of media objects. Numbers are always defined as strings (to allow for Templating).
#Article
This is the officially supported Schema.org Article Schema.
Name | Description |
---|---|
type | Set type to "Article" to use this Schema |
headline | The headline of the article |
section | Comma-separated sections (category names) of the article |
keywords | Comma-separated keywords for the article |
authors | Comma-separated author names |
images | Comma-separated media ids for article images |
wordCount | The number of words in the article as a string |
timeRequired | The time required to read this article in minutes |
#Breadcrumb List
This is the officially supported Schema.org BreadcrumbList Schema. For simplification, a simple items
field is specified as a string instead of having to specify item types, their positions, etc.
Name | Description |
---|---|
type | Set type to "BreadcrumbList" to use this Schema |
items | A comma-separated list of page names and paths. For example "Home /, Products /products, Some Product /products/some-product" |
#Local Business
This is the officially supported Schema.org LocalBusiness Schema. More subtypes and their specific fields will be added soon.
Name | Description |
---|---|
type | Set type to "LocalBusiness" to use this Schema |
subtype | The subtype of LocalBusiness. Currently supported subtypes are "AnimalShelter" , "ArchiveOrganization" , "AutomotiveBusiness" , "ChildCare" , "Dentist" , "DryCleaningOrLaundry" , "EmergencyService" , "EmploymentAgency" , "EntertainmentBusiness" , "FinancialService" , "FoodEstablishment" , "GovernmentOffice" , "HealthAndBeautyBusiness" , "HomeAndConstructionBusiness" , "InternetCafe" , "LegalService" , "Library" , "LodgingBusiness" , "MedicalBusiness" , "ProfessionalService" , "RadioStation" , "RealEstateAgent" , "RecyclingCenter" , "SelfStorage" , "ShoppingCenter" , "SportsActivityLocation" , "Store" , "TelevisionStation" , "TouristInformationCenter" , "TravelAgency" |
name | The name of the business |
description | A description of the business |
url | Path or URL to the business |
sameAs | A comma-separated string of urls that identify the business. Ex: "https://facebook.com/thisbusiness" |
telephone | The business' public phone number |
priceRange | A price range using specific values like "50-500" or digit notation like "$$$-$$$$" |
images | A comma-separated string of media ids for the business' images |
logo | A media id or url to the business' logo |
addressCountry | The country of the business. For example USA or US |
streetAddress | Street address of the business |
addressLocality | The "locality" of the address. The city if you're in the US |
addressRegion | The "region" of the address. The two-letter state code if you're in the US |
postalCode | The postal code of the address. The ZIP code if you're in the US |
geo | The business' geographic coordinates as longitude and latitude. Ex: 28.3771857, -81.6088488 |
hasMap | A link to a map of the business. Ex: "https://maps.app.goo.gl/G8i8C28DYwsM3sZPA" |
openingHoursSpecificationsTemplate | A code template to generate opening hours. This should be an array of opening hours or code that generates an array of opening hours |
openingHoursSpecifications | An array of opening hours of the business. See below |
reviewsTemplate | A template for reviews. See Reviews below |
reviews | A list of reviews. See Reviews below |
#Opening Hours
Each opening hours object has the following keys:
Name | Description |
---|---|
daysOfWeek | A comma-separated list of days of the week these hours apply to. Blank indicates all days. Valid days are Monday , Tuesday , Wednesday , Thursday , Friday , Saturday , and Sunday |
opens | The time the business opens in HH:ss format. Ex: "00:00" |
closes | The time the business closes in HH:ss format. Ex: "23:59" |
validFrom | The date these hours are valid from in YYYY-MM-DD format |
validThrough | The date these hours are valid through in YYYY-MM-DD format |
If the business is closed, use 00:00
as the open and close time, or leave both blank. If the business is open all day, use 00:00
for opens and 23:59
for closes. For hours after midnight, use the time it closes the next day. For example, a bar that opens Friday at 10:00 PM and closes Saturday at 2:00 AM would use daysOfWeek: 'Friday'
, opens: '22:00'
, and closes: '02:00'
.
Do not specify validFrom
or validThrough
if these are the normal business hours.
#Person
This is the officially supported Schema.org Person Schema.
Name | Description |
---|---|
name | The person's full name |
description | A short bio of the person |
images | A comma-separated string of media ids for the person's photos |
jobTitle | The person's job title |
telephone | The person's telephone number |
email | The person's email address |
url | A path or URL to the person's Page |
#Product
This is the officially supported Schema.org Product Schema.
Name | Description |
---|---|
name | The name of the product |
description | A short description of the product |
images | A comma-separated string of media ids for the product's photos |
logo | A media id or url to the product's logo |
ratingCount | The number of ratings this product has received |
reviewCount | The number of reviews this product has received |
ratingValue | The rating of the product as a number between bestRating and worstRating |
bestRating | Best rating on the rating scale. Default is 5 |
worstRating | Worst rating on the rating scale. Default is 1 |
brand | The product's brand |
category | The category of the product |
color | The color of the product |
itemCondition | One of DamagedCondition , NewCondition , RefurbishedCondition , UsedCondition |
keywords | A comma-separated list of keywords related to the product |
size | The size of the product. Ex: XL |
mpn | The manufacturer part number of the product |
material | The material of the product. Ex: cotton |
manufacturer | The product's manufacturer |
reviewsTemplate | A template for reviews. See Reviews below |
reviews | A list of reviews. See Reviews below |
#Accomodation Subtype
To set the Product as an Accomodation, set the subtype
to "Accommodation"
. Accomodations have additional fields:
Name | Description |
---|---|
addressCountry | The country of the accommodation. For example USA or US |
streetAddress | Street address of the accommodation |
addressLocality | The "locality" of the address. The city if you're in the US |
addressRegion | The "region" of the address. The two-letter state code if you're in the US |
postalCode | The postal code of the address. The ZIP code if you're in the US |
geo | The accommodation' geographic coordinates as longitude and latitude. Ex: 28.3771857, -81.6088488 |
hasMap | A link to a map of the accommodation. Ex: "https://maps.app.goo.gl/G8i8C28DYwsM3sZPA" |
petsAllowed | Whether pets are allowed at the accommodation. Either true or false |
amenityFeatures | A comma-separated list of amenities available at the accommodation |
numberOfBedrooms | The number of bedrooms at the accommodation |
numberOfFullBathrooms | The number of full bathrooms at the accommodation |
numberOfPartialBathrooms | The number of partial bathrooms at the accommodation |
#Reviews
This is the officially supported Schema.org Review Schema. The type should be set as "Reviews", not "Review". Even if you only have one review, it must be listed in the reviews
array.
Name | Description |
---|---|
type | Set type to "Reviews" to use this Schema |
reviewsTemplate | A code template to generate reviews. This should be an array of reviews or code that generates an array of reviews. See example below |
reviews | An array of review objects. See below |
Each review object has the following keys:
Name | Description |
---|---|
author | The name of the author who wrote the review |
dateCreated | The date the review was written. This can be in any date format compatible with the Build process |
reviewBody | The text content of the review |
ratingValue | The rating of the review as a number between bestRating and worstRating |
bestRating | Best rating on the rating scale. Default is 5 |
worstRating | Worst rating on the rating scale. Default is 1 |
#Review Template Example
product.reviews.map(review => {
return {
author: review.author,
dateCreated: review.writtenAt,
reviewBody: review.content,
ratingValue: review.rating,
}
})
#Custom
If the Schema you want to use isn't officially supported by MercuryCMS yet, you can provide your own custom data. This still supports Templating.
Name | Description |
---|---|
type | Set type to "_manual" to use this Schema |
body | The entire Schema from scratch to put on the Page |
For example, you can write this for the body
:
{
'@context': 'https://schema.org',
'@type': 'Thing',
name: 'Some Name',
}