The Information Technology Blog brought to you by 4 Ace Technologies

Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Saturday, April 18, 2009

Drupal Event Calendar using Date, Calendar, Views, and CCK

Extracted from: http://www.sagecraft-studios.com/2009/01/drupal-event-calendar-using-date-calendar-views-and-cck.html

I’ll admit it: I am a Drupal newbie. We chose it for our CMS last year, but we haven’t really been using it as a CMS as much as a place to dump and view our internal key indicator reports. But finally! Ah, yes… we finally have a feature request that is actual content management - an event calendar.

Imagine my surprise when I go looking for an event calendar module and find nothing. How could such a huge CMS not have a simple event calendar? A big part of this misunderstanding was that I didn’t understand Drupal - at all. I still don’t really, but figuring this feature out has helped a lot.

One thing to realize is that Drupal is a content management system. So (eventually) it would make sense to create event content and display that content in a specific way. I surprisingly couldn’t find much documentation on this, so below are the steps I took to get my event calendar up and running. They’re kind of abbreviated, so just ask if you need any clarification. Keep in mind this was a learning experience, so if you have any tips for me, I would like those as well. ;)

  1. ## Install Modules
    • View
    • Date
    • CCK
    • Calendar
    • Don’t forget to give yourself permissions to administer these modules and enable them!
  2. ## Create Calendar Event Content Type
    1. Name: Event
    2. Type: event
    3. Title Field Label: Event
    4. Body Field Label: Details
    5. Do not promote to front page.
    6. Save
    7. Go to Manage Fields for Event in the content type list
    8. Add a field called Date of type fieldeventdate with a textfield/popup calendar+repeat selector. Configure it to be required and blank by default, have a reasonable format, and to hide the repeat options by default.
    9. Add a field called Location of type field_event_location that is a single-row text field. Configure it to be 100 chars long and required.
  3. ## Set up A Calendar View
    1. Go to Administer > Views
    2. Enable the default calendar view and clone it.
      • View Name: a_calendar
      • View Description: Calendar
    3. Change the title to “Whatever you want Calendar”
    4. Change Arguments > Date: Date (Node: Updated date) to Content: Date (field_event_date value) Scroll down a bit to see the checkboxes (under Date fields)
    5. Add a sort criterion for Content: Date (field_event_date value)
    6. Add a filter for Node: Type is one of Event
    7. Click the Calendar page side-tab and change the path to “a_calendar”
    8. Click the Calendar block side-tab and change the block settings admin to “A Calendar”
    9. Save the view.
    10. Navigate to ?q=a_calendar to make sure it is working.
  4. ## Set up Roles
    1. Add a new role called Calendar_User and add the following permissions:
      • Edit/view field_event_*
      • (Create | delete own | edit own) event content
    2. Give this role to whoever you want to create event entries. (Let’s call them eventries for fun)
  5. ## Add a link somewhere and enjoy!


4 Ace Technologies