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.
February 9th, 2009 on 21:03
Do you have demonstration of what the calendar created through this process looks like?
Thanks
February 10th, 2009 on 11:40
yes I will put a example of the final calendar for you very shortly…..
February 21st, 2009 on 19:38
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.
March 27th, 2009 on 22:44
thanks for your post — no problems. all good. saved me lots of effort/time.
September 1st, 2009 on 16:27
Thanks, very useful!
Tammo
January 22nd, 2010 on 12:40
Thanks.
Setting the View arguments was not easy without screen shots.
Many thanks though.
April 13th, 2010 on 01:14
For some reason, I’m getting the events filed under a date other than the one I set in the field (which would be the current one)
May 25th, 2010 on 22:08
Thanks!
June 17th, 2010 on 19:47
Thanks for this.
Do you know how to create a view that will display only the upcoming events in a block?
June 18th, 2010 on 14:44
Too bad this doesn’t work for “multiple days dates”. If I set both a from and to date on a node, only those 2 dates are displayed on the calender, not the dates in between…
Cheers!
September 14th, 2010 on 21:07
Thanks for the nice step by step. One problem though and I’m sure it has got to do with the view settings. When I add the View to my homepage (Upcoming Events) and I only have 2 events for example, both on the same day, I get the first event listed 5 times.
1- Shouldn’t it list only 2 since I don’t have 5?
2- How can I make it pick up the events properly? I followed the same settings as you mentioned above.
Any feedback would be much appreciated.
Thanks,
November 1st, 2010 on 15:08
I would like to subscribe to this. I am having difficulties showing only the upcoming events and have them in order of the events. It seems I can only sort alphabetically. Any advice?
Thank you
November 11th, 2010 on 00:07
Thank you for this! I’ve been searching for hours for this solution!
November 19th, 2010 on 20:29
Thanks, useful article.
January 4th, 2011 on 18:56
Anyone else get a memory overflow when saving the view? The memory limit is set to 64MB.
February 5th, 2011 on 06:25
Hi. Thanks so much for this. I’ve been pulling my hair out for a few days trying to figure out the calendar.
I followed all your instructions and everything seemed ok until the end. The calendar won’t show. I shows this error message -
The Date Popup module now requires the jQuery UI module as a source for the datepicker. Please install it immediately.
I have all the jquery installed (module, plugin, datepicker). But for some reason, it’s not find the module.
Do you have any suggestions on how to fix? Thanks mate!
February 5th, 2011 on 11:15
Hi Bob, this post is a bit old, so probably some of this modules are not compatible with the last versions of drupal, however after a quick googling I found this 2 links, maybe some of them can help you with that issue:
http://drupal.org/node/943058
http://drupal.org/node/895558
Cheers
João
February 14th, 2011 on 00:26
Hi. Thanks for finding those two links. I tried everything suggested in them and unfortunately they didn’t work. I uninstalled then reinstalled several times and still didn’t work. Drupal 6 isn’t recognizing some of the modules, even though they are the latest versions.
Good news though – I did find a temporary solution. I just created a node and entered the xml setting from google calendar. Calendar shows up good and works fine. The only thing with this method is that users have to have google calendar and link to my calendar. They won’t be able to enter events thru the site.
Anyways, it’s a start. Thanks so much for all your help.
Bob
May 23rd, 2011 on 21:51
Thanks, Nice article, it helped me solve calander view issues.