Schema.org tutorial: Event

Last updated on
30 April 2025

This tutorial describes how to build event pages and how to annotate them using the Schema.org module. The goal is to create a page that displays information for a specific event which can be previewed in the Google Rich Snippets Testing Tool.

Google Rich snippet preview of an event powered by the schema.org Drupal module and RDFa

We will use the Schema.org Event type which is one of the schema.org types recognized by Google. You can see this tutorial in action in the Drupal schema.org module screencast. You can view an example event page and its preview in the testing tool.

Background Information

schema.org is a collaboration of Google, Yahoo! and Bing to standardize the way structured data is added to web pages. The schema.org vocabulary includes descriptive terms for content like movies, people, organizations, events, locations, etc. The goal is "to improve the display of search results, making it easier for people to find the right web pages."

Step 1: Install required modules

This tutorial uses the schema.org and the Date on your site, which includes a nice Popup widget (make sure to enable the Date popup module). Learn how to install a contributed module in Drupal 7.

Step 2: Create a new content type with schema.org settings

Go to Structure -> Content Types -> Add content-type and create a content type with the following name and description:

  • Event
  • Event that uses schema.org Event Type and Properties

In this tutorial we're not going to worry about any content-type settings other than the Schema.org Settings. Click on 'Schema.org Settings' near the bottom of the page, and fill in a type in the autocomplete field. When you start to type the word 'event' a dropdown list will be displayed and will list all possible Types. Select 'Event'.

Click 'Save and add fields'

Field settings

Now we'll add some fields and assign them various schema.org properties.

Edit the body field, and at the end of the form, enter 'description' in the schema.org mapping input.

On the Manage Fields tab of your event content type, create a new field called 'Date' and select of the date formats in the field type drop down list (the first one will do). In the widget drop down, choose Pop-up calendar. Click save. On the next form, click Save field settings. At the bottom of the next form, enter 'startDate' for the schema.org mapping and click Save settings.

Repeat the same procedure for the creation of the 'Location' field, which will be mapped to the schema.org 'location' property.

Here is a run down of the schema.org mappings:

Field Schema.org mapping
type Event
Body description
Date startDate
Location location

Note that these are the fields Google requires to generate a preview. Make sure to have the right mappings on all these fields for the preview to work. You can change the field names as long as the schema.org mappings are correct.

The Event content type is now listed under: Structure -> Content type.

Step 2. Add content using the Event content type.

We'll be adding the 2014 Winter Olympics event in this example. Go to Add content -> Event.

Enter the following information in the appropriate fields:

  • Title: 2014 Winter Olympics
  • Body: A culmination of the brightest Drupal minds in the technology hub of the world
  • Date: February 07, 2014*
  • Location: Sochi, Russia

Click 'Save'.

If everything went as planned a node about the 2014 Winter Olympics event should have been created. *: Note that Google will not generate a Rich Snippet preview for past events.

We have successfully added a schema.org type and properties to our Drupal page. The event node page can now be tested in the Google Rich Snippets testing tool, simply paste the URL of the node and hit preview.

Support

If you experience difficulties setting up your content type, or if it cannot preview it correctly in the Google Rich Snippets testing tool, please file a support request in the schema.org module issue queue.

Help improve this page

Page status: Not set

You can: