Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Event syncing

Events are pulled from iModules every 15 minutes using a cron process which checks for newly updated events. It works by pulling a list of events that have been updated or created since the time of last sync, and importing them one by one, either creating a new event or modifying an existing one.

...

The main functionality for this sync and import process are located in the custom plugin "Cornell Events"

Field Mapping

When fields are imported from the iModules API, they are mapped to our existing WordPress data structure. The title is pulled from the iModules title field, content from the full text field, and excerpt from preview text. Start and end dates for both the event itself and registration are also pulled and then added to the proper metadata fields in WordPress.

...

  • Venues are added with:
    • LocationName : Address
    • LocationDirections : Directions, not shown on front-end

 

Featured Images

Featured images are imported directly from iModules during the sync process. The first image in the iModules content field, if one exists, will be used as the imported events featured image. Featured images will be imported, optimized and resized based on standard image specifications. In general, events featured images follow the same specifications as all other images, meaning they will be imported, optimized and resized to accomodate both archive and single page listings. Like posts, these images should be as large as possible when added in iModules so that they can be resized, and should use the same aspect ratio as individual post images, 840 x 560.

If an alt tag is added to the image in iModules, this alt tag will also be imported with the featured image.

Venues and Timezones

Venues are also imported from iModules if one needs to be created. Each time a new venue is created, it's timezone will also be set based on geographic location so that timezones for events are properly updated.

Event Archives and Listings

The Events Calendar and Events Calendar Pro plugin are used to actually display a list of events on the front-end, and organize the data.

...

The main archive template file is located in the theme folder, cornell/archive-events.php. All individual template partials can be found in the tribe-events folder in the theme.

WP CLI Commands

There are also a few helpful WP CLI commands which can be used to manually run a sync or disable cron. They can be run using terminus, once logged in.

...