Skip to content Skip to navigation

Importing Events from events.stanford.edu

Have you checked out Stanford's Event Calendar at http://events.stanford.edu? It has featured events, events from departments and student groups, and events by subject or type. It's a great place to find out what's happening around campus.

However, if you're like me, I don't always think to go to the website and check the calendar. Now, through the magic of RSS feeds and Stanford Event Importer 2.x, you can select your favorite event feed and have those events copied on to your website.

John Bickar at Stanford Web Services led the development of this convenient module for Stanford. If your website is on the Stanford Sites service, this module is already installed for you. Otherwise you can download it from Stanford Drupal Features server at: http://drupalfeatures.stanford.edu/project/stanford-events-importer

The Stanford Event Importer takes data from the Stanford Event Calendar feed, and then creates and populates event nodes on your site with the event information.  The event information can come from either a category or an organization on the Stanford Event Calendar. Here's how to put the Stanford Event Importer to work on your site.

Create the Stanford Event Importer and import events

To use the Stanford Event Importer you’ll need to create a Stanford Event Importer node, which will define the events to import.  

Before starting, be sure to have the following information ready:

  • Title of your Event importer
  • Category or Organization from which feed to import.  The Category corresponds to the “By subject” and “By type” items on events.stanford.edu.  Consider visiting events.stanford.edu, and counting approximately the number of items in the feed.  Then, when importing items, compare this number to the number of items imported.

Here’s how to create the event importer:

  1. From the Admin Menu, Navigate to: Content > Add content > Stanford Event Importer
  2. Enter the title of your importer.  
  3. Select either a category or organization for your importer 
  4. Scroll to the bottom of the page and select “Save”

Upon saving the new event importer, the importer will immediately import the items from the feed.  

Check your results:  

You may want to make sure that the events imported are the ones you expect:

  1. Select “Content” from the Admin Menu
  2. Under “Type” select “Stanford Event.”  
  3. Click on “Apply”
  4. If necessary, sort by date by clicking on the “Updated” column header.
  5. Select the most recent event and check that it reflects the information that you expected.  

Updating the importer:

Did you forget to add a tag to the events you imported?  Maybe you imported the wrong feed?  Not to worry. Here’s how to update or change the importer and the items you’ve imported:

  1. Find the Stanford Event Importer node you originally used to import the items.  You can do this by selecting “Content” from the Admin Menu
  2. Under “Type” select “Stanford Event Importer”
  3. Click on “Apply”
  4. Scroll through the list until you find the importer to update.
  5. Select the importer by clicking on the title
  6. Select the “Delete Items” tab
  7. Click on “Delete” on the confirmation page.
  8. Select “Edit”
  9. Make your changes to the importer
  10. Scroll to the bottom of the page and click on “Save” to save your changes.
  11. After saving, import the events with the new criteria by selecting “Import”
  12. Select “Import” on the confirmation page

Verify the import:

  1. Verify the number of nodes created corresponds with what you expect
  2. Verify your results as described in the section above under “Check your results”

Adding Taxonomy terms to Events

Once you have created your importer, you can add additional information for your particular website to the events as they are imported. For example, to add taxonomy terms to events, add the taxonomy term field to both the Stanford Event content type and to the Stanford Event Importer. On your importer nodes, select the terms:

  1. Navigate to Structure > Feed Importers
  2. Select your desired importer
  3. On the Importer Configuration page under the "Processor" horizontal tab, select "Mapping."
  4. Scroll to the bottom and from "Select a source," select the taxonomy field on the importer.
  5. From the "Select a target," select the taxonomy field for the event.
  6. Click on "Add"
  7. Scroll to the bottom of the page and click on "Save"

Now when you import your events, they will be tagged with the same terms as the importer.

If you like this module, check out its sister module, Stanford Courses, at https://drupalfeatures.stanford.edu/project/stanford-courses. It will import courses from http://explorecourses.stanford.edu.

Categories: