Drupal and UBC Events

Posted by: | February 24, 2012 | Leave a Comment

UBC Events is a great tool which lets event providers (UBC units, student associations etc.) publish their events into a central events calendar. It comes with tagging and various feeds that allow you to aggregate the content or publish content automatically on your own blog or website. The simplest use case is that you would like to follow a specific event provider or all events within a certain category. UBC Events works great for that!

Our requirement was a little more complex and unfortunately could not yet be met out of the box through UBC Events itself, at least I did not find the solution. However, with a powerful CMS such as Drupal, the functionality can easily be extended to meet other needs.

Requirements:

  • Subscribe to a defined set of calendars
  • Publish only events that belong to multiple categories at the same time from the set of calendars!

The difficulty in this case was that the event cannot be in either or category, but has to be tagged with all of them simultaneously. Moreover, we wanted to be able to have various ways to display the content, either by calendar or by tag or by any combination. In particular, we wanted to be able to pull all events that are relevant for graduate students (tag “Audience – Graduate Students”) from various partners (defined set of calendars) and combine these in different pages (e.g. a Grad Student Professional Development event listing, ie. tag “Subject – Personal and Professional Development – Students”).

Drupal has an aggregator that comes with the core modules (called aggregator) which I tried first. The setup is really straightforward and only takes a few minutes to configure. We have so far used it to bring in Faculty news which then get displayed for each faculty in the sidebar of our faculty descriptions. The important thing is that imported feed items get stored in a separate table, ie. imported content does not get a node ID like our own content. As I discovered, this tool does not bring in the categories either. It worked great, but the core requirement to filter the content by category could not be met without customization. Otherwise, you get a really nice output of the content by using views (with aggregator as base, not node!) that can be sorted and ordered. This image shows events from 4 different calendars in a list:

One disadvantage of the aggregator view is that you cannot expose some of the fields as filters.

My next try involved a super powerful module called feeds. I absolutely love this module. It can bring in all kinds of content from various web sources and formats and even local files. It has a very handy field mapping functionality which gives you full control over each source field and how it will be mapped to your target content type fields.

With feeds you have to create a content type that stores the feed source as well as a content type to which you will import the content. The difference to aggregator is that each imported item really becomes part of your site with its own node id. This offers multiple scenarios that can meet different needs. We use a workflow process in our site for example which can be configured so that imported content does not automatically get published, but requires approval from a supervisor. In that sense you can keep control over what appears on your site, but eliminate manual content entry. I configured the module and brought the events into a specific content type which can have various fields, including categories. The results look reasonably without much extra work required.

However, Drupal can really shine when we start using the aggregated content with views. Now that we have the content as nodes in our site, the full feature set of views is available.

In this sample I exposed the feed provider as a filter and the table can be sorted and ordered. The really useful option available to us in this setup is the possibility to select any category that we want to display.

This covers most scenarios, but it has limitations as well. If you plan to go totally crazy on selections like provider 1 with tag workshop or provider 2 with tag conference or provider 3 with tags workshop or conference, you might run into problems with the views module. Views 3 now includes grouping with “and” and “or”, but not all modules can be incorporated. Taxonomy for example is not groupable. If you are still using views2, the module views_or could offer you a solution for very complex queries… This has immediate implications on the decision if you import external events to an existing content type or a new content type. For us it was important to keep the workflow for the existing content type which was used in over a dozens displays and to use a different workflow for the imported events. However, this approach limits how we can combine our own events with imported events in the same sortable view. A quick and dirty fix would be to import a subset of our own events…


Comments

You must be logged in to post a comment.

Name (required)

Email (required)

Website

Speak your mind

Spam prevention powered by Akismet