Skip to main content Skip to secondary navigation

Events Importer

Main content start

Stanford Sites Event Importer takes data from the Stanford Event Calendar feed and populates event nodes on your site with the event information. Imported events will be included with your internally-created event listings at the URL path [your site url]/events.

You can import events based on an organization, audience group, event subject, as well as by event type on the Stanford Event Calendar.

Once the importer has been created, events will be imported and updated daily. If you want to import events immediately, you can use the Save & Import button (found within the Events Importer editor).

 Learn about importing events

Learn about displaying events 


Stanford Events Calendar Update: On Feb. 1, 2022, Stanford launched a new campus-wide events calendar. Stanford Site can import events from the new Localist Stanford Events Calendar, as well as the Stanford Events (legacy) Calendar. This page will provide a step-by-step guide on how to:

  • Import Events from the new Localist Stanford Events Calendar
  • Display Events using the Localist Widget
  • Turn off an import from (legacy) Stanford Events Calendar.

Stanford Events (legacy) calendar 

The Localist Stanford Events calendar replaces the previous Stanford Events (legacy) Calendar. 

Existing links that were imported from the legacy calendar will remain on your site, and the links will continue to point to your events in the legacy calendar. If you decide to create the same event in the Localist calendar, you will have to import it into your site and delete the previously-imported Event from your site.

Learn more about the Localist Stanford Events Calendar

How to turn off the legacy Stanford Events importer 

After you begin importing events from the Localist event importer, you'll want to stop importing events from the legacy importer. 

  1. Navigate to  Configuration > Importers > Events Importer to see the Events Importer configuration page
  2. Find the Events to be Imported section.
  3. For the importer you want to turn off, set each field back to its default:
    • Set the Event Group Option to Select Option
      select group on events importer
    • Set the Organization to Select Organization 
      default events importer settings
  4. Scroll to the bottom and click Save
    save importer setting

Using the Localist Stanford Events importer 

When you import events from Stanford Events Calendar your site creates event nodes and allows you to display these events on your site.

To import events

  1. From your site’s admin menu select Configuration > Importers > Events importer
  2. Scroll down to the Localist URL section to import events from the Localist Stanford Events Calendar.
  3. Add filters to import events based on Audience, Subject, Event Types, Departments/Groups and/or Venues.
  4. Once you are satisfied with your import selections, scroll to the bottom of the page and select either:
  • Save & Import: Saves your selections and executes an import update immediately
    • If you selected Save & Import you should see a message about the number of events imported. 
  • Save: Saves your selections, but executes an import during daily import
  1. To see the imported Events, from your site’s admin menu go to All Content and filter by the Event Content type.

Events are be imported and updated daily. To execute an update immediately select Save & Import.

Troubleshooting

If a department or group is not showing as expected, click Update Org & Category Options to refresh with the latest list of Departments/Groups and Categories from Localist.

What will be imported?

Using the importer pulls events from Stanford Events Calendar into your Drupal site so that content becomes part of your content library. You can display or reuse the Event content within your site. The Event Importer will import the following fields:

  • Event Type
  • Event Title
  • Body Content (from the Localist Description field)
  • Date & Time (Start Time and End Time)
    • Note: If you don’t have an End Time in Localist, the importer sets the End Time to match the Start Time. Only the Start Time will be displayed on the Event.
  • Event Place 
  • Audience 
  • Link to view the event on Stanford Events Calendar

Note that by default, Events imported from Localist will link to the event on Stanford Events. If you want to display the event on your site instead, edit the External Source field to remove the URL.

Also, note that events remain editable on Localist. When you update an event on Localist, it will be imported the next time the importer runs, and it will update the existing Event node on your site. However, this only works one way: if you update an Event node on your website, it will not push the update to Localist.

Questions about using the Localist Events importer? Submit a Help Request.

More on the Localist importer

How do you delete an event importer?

​​To remove an events importer, remove the criteria from each field item on the importer configuration page.  When you save it, the importer will be removed.

  1. Navigate to  Configuration > Importers > Events Importer configuration page
  2. Remove the criteria from each field. 
  3. Scroll to the bottom of the page and click Save

How do you delete all the events from an importer?

To delete the events which were imported by either importer, delete them in the normal way you would remove content from Stanford Sites.  Use a bulk editing function or remove them one at a time.

How do you display just the events from a particular event importer?

You cannot simply display just the events from a particular importer.  Once the events are imported, they’re just regular Drupal content. It is possible to manually specify and display your events by event type after they have been imported.

How do you import a bookmarking/custom feed?

Bookmarking allows event admins to add events hosted by other departments to their own department’s XML feed for import into their own website. To create your custom feed and bookmark your events, go to the Bookmarking / Add to custom feed page on the Events Help site at: https://events-help.stanford.edu/connections/bookmarking-add-to-custom-field/

Once you have your custom feed, you can add the URL to the Localist Bookmarked Events section on the event importer configuration page.

  1. Navigate to  Configuration > Importers > Events Importer configuration page
  2. Scroll down to the Localist Bookmarked Events section
  3. Paste the URL from your custom feed
  4. Scroll to the bottom of the page and click Save

 

Redirects 

Once an event is imported, it has a redirect that points back to the event page on Stanford Events Calendar.

Events that have previously been imported, are on the legacy events calendar, and have redirects, will no longer work.

Display Events using the Localist Widget

Rather than import all the events into your site, it is possible to create a Localist widget that displays your events and then embed the widget into your site.

Build your Stanford Events Localist widget

  1. Go to the Stanford Events Calendar Build an Events Widget page.
  2. Choose a style template and number to items to display
  3. Generate a list of events by selecting the content you want to include from the drop-down menus. Learn more about building an Events Calendar Widgets.
  4. Click Preview Widget to review what it will look like.
  5. When you’re ready, click the Generate Widget Code
    localist widget generate code

Add Stanford Events Localist widget to your site

  1. Copy the embed code.
    localist widget code
  2. Returning back to your Stanford Site, from your site’s admin menu navigate to All Content > All Media > Add Media > Embeddables.
  3. Paste the code in the Embed Code box.
  4. Enter a name for the widget that describes the content, for example, “BeWell Events Localist Widget.”
  5. Click Save
    localist widget embed

Once the embedded has been added to your site's media library, use the text area paragraph type to display events. 

 

Troubleshooting

I get an error saying "Could not find the stanford_events_importer migration!"

Scroll to the bottom and click Save instead of Save & Import. Clicking Save processes your selections, but executes an import during daily import. 

An event previously added has been removed from Stanford Events (localist), but the imported page remains on my site showing as a 404 error.

In these cases, you will have to delete the event on the site manually as these events will not be automatically deleted. The system will only return future events but will not know if an event was deleted or has just occurred.