João Machete

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

by admin on Jan.21, 2009, under General

Some of my good friends from the university have recently to setup upcoming event calendar on Drupal 6.x. I spent some time trying to help them and I had a hard time finding instructions…..so here’s my experience…

I used this modules:

Download and install the above modules to /sites/all/modules and enable them at Administer › Site building > Modules

Step 1: make a custom ‘event’ content type using CCK

Go to Administer › Content management › Content types > add content type

Name = “Group Event
Type = “event
Description = “Create a new event to appear on the sites calendar of upcoming events

The following settings are largely a matter of site needs and personal preference:

Under “Submission form settings
Title = “Event
Body = “Details

Under “Work flow settings
Decide to best fit your site. It is worth considering unchecking “Promoted to front page” if you expect to have numerous small events posted.

Under “Comment settings
Make decisions which are appropriate for your site.

Save your new event content type.

From the content type screen (Administer › Content management) select manage fields next to your new content type.

Add a new field

Label = “Event Date and Time
Field name = event_datetime
Type = “Datetime
Widget type = “text field with custom input format

The widget type dictates the input UI and is really a matter of preference. It’s easy to change after the fact so try them all and see what you like best.

Save your newly created event date/time field.

The field options on the following page are reasonably self explanatory and a matter of taste.
Pay attention to the “To Date” option as it will allow you to set the end of your event (more important if you want an iCal feed ultimately).
For most people

Granularity = year, month, day, hour, minute (not second) selected
To Date = optional will be correct

You can of course add any number of additional fields to your event content type at this point using CCK. I’ve added location and contact information for my application and tied those to weather and profiles which is kind of cool (but way beyond this little write up) and testament to how amazing Drupal really is.

Step 2: Create your first event

Create content > Group Event
Fill out the form for your event and save it.

Step 3: Configure your calendar view

Administer > Site building > Views
This is where the hurt started for me 6 hours ago…

Enable the Default Node view: calendar (Calendar)
Clone the default view
View name = “calendar
View description = “Calendar of group events

Nextshould take you to the views edit screen

Down the left side you’ll see all the different types of calendar (page, block etc) just work with the default view to start (it should be where you are by default).

In the Arguments panel
Click Date: Date (node.changed)
Near the bottom of the page under Date field(s):
uncheck = Node: Update date
check Content: Event Date and Time (field_event_datetime value)

Click Update

This set the start time of your event instead of the node update time as the argument for the view.

On the Filters panel click the “+” logo to add a new filter
Check = Node: Type
Click add
On the following screen
Leave operator = “Is one of and check = “Events to limit your calendar to only the event content type.

Click Update

On the Sort criteria click the “+” to add a new criteria
Check = Content: Event Date and Time (field_event_datetime value)

click Add

Save it all by clicking Save

Step 4: make sure it works

Use the View “Calendar page link” to confirm your new calendar is up and working.

That will at least get you to a working calendar of coming events for your site. Obviously you’ve got a ton of configuration options to play with form here.

This is a very powerful package. While it’s not hard to setup it’s got a lot of steps and many opportunities to go wrong. The key here is to set the argument / sort / filter bit of views configuration. This combination of modules seems to want to create a calendar widget for digging into the archives by default but it is easy enough to have it do otherwise.

Hope this is helpful for someone down the road.

:
6 comments for this entry:
  1. Tim

    Do you have demonstration of what the calendar created through this process looks like?

    Thanks

  2. admin

    yes I will put a example of the final calendar for you very shortly…..

  3. Braam

    Thanks! This has saved me a lot of time, I have the calendar setup working for my personal site using your guide.

    What’s missing in this howto is the enabling of the modules, but I guess any drupal user knows about that.

  4. ayla

    thanks for your post — no problems. all good. saved me lots of effort/time.

  5. Tammo

    Thanks, very useful!

    Tammo

  6. Johnny

    Thanks.
    Setting the View arguments was not easy without screen shots.
    Many thanks though.

Leave a Reply

Spam protection by WP Captcha-Free

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...