Basics
Features
Best Practices
Addon Development
Related Docs
Dark Mode

#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.

NameDescription
typeSet type to "Article" to use this Schema
headlineThe headline of the article
sectionComma-separated sections (category names) of the article
keywordsComma-separated keywords for the article
authorsComma-separated author names
imagesComma-separated media ids for article images
wordCountThe number of words in the article as a string
timeRequiredThe 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.

NameDescription
typeSet type to "BreadcrumbList" to use this Schema
itemsA 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.

NameDescription
typeSet type to "LocalBusiness" to use this Schema
subtypeThe 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"
nameThe name of the business
descriptionA description of the business
urlPath or URL to the business
sameAsA comma-separated string of urls that identify the business. Ex: "https://facebook.com/thisbusiness"
telephoneThe business' public phone number
priceRangeA price range using specific values like "50-500" or digit notation like "$$$-$$$$"
imagesA comma-separated string of media ids for the business' images
logoA media id or url to the business' logo
addressCountryThe country of the business. For example USA or US
streetAddressStreet address of the business
addressLocalityThe "locality" of the address. The city if you're in the US
addressRegionThe "region" of the address. The two-letter state code if you're in the US
postalCodeThe postal code of the address. The ZIP code if you're in the US
geoThe business' geographic coordinates as longitude and latitude. Ex: 28.3771857, -81.6088488
hasMapA link to a map of the business. Ex: "https://maps.app.goo.gl/G8i8C28DYwsM3sZPA"
openingHoursSpecificationsTemplateA code template to generate opening hours. This should be an array of opening hours or code that generates an array of opening hours
openingHoursSpecificationsAn array of opening hours of the business. See below
reviewsTemplateA template for reviews. See Reviews below
reviewsA list of reviews. See Reviews below

#Opening Hours

Each opening hours object has the following keys:

NameDescription
daysOfWeekA 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
opensThe time the business opens in HH:ss format. Ex: "00:00"
closesThe time the business closes in HH:ss format. Ex: "23:59"
validFromThe date these hours are valid from in YYYY-MM-DD format
validThroughThe 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.

NameDescription
nameThe person's full name
descriptionA short bio of the person
imagesA comma-separated string of media ids for the person's photos
jobTitleThe person's job title
telephoneThe person's telephone number
emailThe person's email address
urlA path or URL to the person's Page

#Product

This is the officially supported Schema.org Product Schema.

NameDescription
nameThe name of the product
descriptionA short description of the product
imagesA comma-separated string of media ids for the product's photos
logoA media id or url to the product's logo
ratingCountThe number of ratings this product has received
reviewCountThe number of reviews this product has received
ratingValueThe rating of the product as a number between bestRating and worstRating
bestRatingBest rating on the rating scale. Default is 5
worstRatingWorst rating on the rating scale. Default is 1
brandThe product's brand
categoryThe category of the product
colorThe color of the product
itemConditionOne of DamagedCondition, NewCondition, RefurbishedCondition, UsedCondition
keywordsA comma-separated list of keywords related to the product
sizeThe size of the product. Ex: XL
mpnThe manufacturer part number of the product
materialThe material of the product. Ex: cotton
manufacturerThe product's manufacturer
reviewsTemplateA template for reviews. See Reviews below
reviewsA list of reviews. See Reviews below

#Accomodation Subtype

To set the Product as an Accomodation, set the subtype to "Accommodation". Accomodations have additional fields:

NameDescription
addressCountryThe country of the accommodation. For example USA or US
streetAddressStreet address of the accommodation
addressLocalityThe "locality" of the address. The city if you're in the US
addressRegionThe "region" of the address. The two-letter state code if you're in the US
postalCodeThe postal code of the address. The ZIP code if you're in the US
geoThe accommodation' geographic coordinates as longitude and latitude. Ex: 28.3771857, -81.6088488
hasMapA link to a map of the accommodation. Ex: "https://maps.app.goo.gl/G8i8C28DYwsM3sZPA"
petsAllowedWhether pets are allowed at the accommodation. Either true or false
amenityFeaturesA comma-separated list of amenities available at the accommodation
numberOfBedroomsThe number of bedrooms at the accommodation
numberOfFullBathroomsThe number of full bathrooms at the accommodation
numberOfPartialBathroomsThe 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.

NameDescription
typeSet type to "Reviews" to use this Schema
reviewsTemplateA code template to generate reviews. This should be an array of reviews or code that generates an array of reviews. See example below
reviewsAn array of review objects. See below

Each review object has the following keys:

NameDescription
authorThe name of the author who wrote the review
dateCreatedThe date the review was written. This can be in any date format compatible with the Build process
reviewBodyThe text content of the review
ratingValueThe rating of the review as a number between bestRating and worstRating
bestRatingBest rating on the rating scale. Default is 5
worstRatingWorst 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.

NameDescription
typeSet type to "_manual" to use this Schema
bodyThe 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',
}