Events, calendars and views
A recent fascination with schedules led me to the Drupal calendar module. In principle, using the module is simple. Suddenly, however, I found myself immersed in the world of Views and revisiting the Content Construction Kit (CCK).
A joyful AHAH moment arrived earlier than expected. The calendar module has dependencies, understandably, with the Date API (included with CCK); a view must be configured to provide a suitable rendering of date-enhanced content types. This last detail (date-enhanced) is critical for displaying events in a calendar.
The process of enabling Views, Content, Calendar and Date dependencies was not complicated. Start by reading the "Depends on" list for the Calendar (Views) module. Enable the Views and Date API modules. You will need to enable the Content module also, so save yourself some aggravation and do that as well. Click "Save Configuration" and you will be able to enable a few more prerequisite modules. Depending on your desires, several passes of enabling modules and saving configuration will be required. Minimally, you will enable the following modules :
- Views (Views)
- Views UI (Views)
- Date API (Other)
- Content (CCK)
- Date (CCK)
- Calendar (Views)
After enabling modules, module configurations are necessary. Start by configuring content types associated with calendar views. I created a simple content type which I named "Event" with a type of "event". Adjust the workflow to your preferences; my preference was to only assert the "Published" default option. After you click "Save content type", edit the newly created content type and visit the "Add Field" tab to include the essential date content field — I used the "Select List" (Date) type and named it "event_date" with a Label of "Date". Mark the field as "Required" because that is how the calendar API is hooked; finally save your type and configure users' permissions to create and edit content of the newly created type. You're almost ready for a calendar.
After creating a suitable content type and configuring permissions, your site is ready to collect calendar driven content. While nothing prevents adding content at this time, I find it more satisfying to see an empty calendar populate with indicators as new content is added. To start with an empty calendar, a view must be enabled to associate with the new content type.
Telescope into the "Administer" pages, through "Site building" to "Views" and establish an appropriate view for your calendar. If the calendar for your site will not vary in purpose nor vary in report, simply enable and modify the supplied calendar view. Properly, you should clone the provided calendar view by activating the "Add" link and customizing the cloned view. There could be some confusion between the various options; a guide to generate a simple page view with a menu link follows.
- Basic Information
- Provide a name for the specifc view
- Assert that appropriate users can see the view.
You probably want all users to be allowed. Clear all user role checkboxes for that configuration. - Give a description which properly associates calendar configuration for site administrators.
- Page
- Enable "Provide Page View"
- Supply your preferred "URL" for the page view
For a single-calendar site, "calendar" would be appropriate. - Consider having a page "Title"
I used Events for my page title. - Menu
- Enable "Provide Menu"
- Give "Menu Title" an appropriate label.
- Date
From "Add Field", select the date field which is associated with your calendar. Any date-formatted field will work (perhaps "Node: Created Time") but you must have one. - Click "Save" and admire the result of your effort.
Post new comment