Community Documentation

Cookbook: Prepare an Event-Calendar for Drupal 7

Last updated May 26, 2012. Created by wusel on March 11, 2012.
Edited by scalico, wmostrey. Log in to edit this page.

This Cookbook shows, how you can prepare an event-calendar for Drupal 7, using the new method to create new calendars from a template.

Cookbook:

Step 1: Before we start

  1. If not enabled, download the modules Ctools (http://drupal.org/project/ctools), Calendar (http://drupal.org/project/calendar), Date (http://drupal.org/project/date) and Views (http://drupal.org/project/views) and install them to your modules-path like sites/all/modules.
    Visit 'http://example.com/admin/modules' and enable the modules "Calendar", "Date" and "Views UI". After Clicking on "Save configuration" click "Continue" to enable all required dependencies too.
  2. Visit 'http://example.com/admin/structure/types' and click on "Add content type".
    Name ='Event', Description like 'An Event with Title, Date/Time and a Body for detailed informations'. Then click on "Save and add fields".
    In line "Add new field" select Type of data to store = "Date (ISO format)", Label ="Event-Date", Field name = "field_event_date", Form element to edit the data = "Text field", then click on "Save".
    On the page "Field settings": set "Collect an end date" to yes and "Time zone handling" to "No time zone conversion" [1] and then click on "Save field settings".
    On the page "Event settings" set "Required field" to yes and then click on "Save settings".
  3. Only if you want:
    Visit 'http://example.com/admin/structure/types/manage/event/display': on "Custom display settings" set all options (like "Teaser") to no and then click on "Save".
  4. Visit 'http://example.com/admin/structure/views/add-template' and add "Calendar - A calendar view of the 'field_event_date' field in the 'node' base table.". On "/admin/structure/views/view/calendar/edit" click on "Save".
  5. Visit 'http://example.com/admin/config/date/calendar' and do the Calendar Administration.
  6. Add a second menu-entry if you like, e.g.: Menu link title = "Event-Calendar", Path = "calendar-node-field-event-date".
  7. Set the calendar-blocks for "View: Calendar" visible as you like on 'http://example.com/admin/structure/block'.

Step 2: Add one or more events

To test: Click on "Add content" in the Navigation-menu, select "Event":
Title = "My first event", Body like "This is the first event", change nothing, Click on "Save".
Later you have to enter/import the event-time in the timezone of the location of the event. [1]

Step 3: View the event-calendar

Visit 'http://example.com/calendar-node-field-event-date'.

Notes:

[1]: This is the recommended setting, which later cannot be changed, without deleting all events prior to that! If you choose the "Time zone handling" to "No time zone conversion", then there is no changing of the time of the event between adding/importing and viewing, neither in summertime nor in wintertime. You have to enter/import the event-time in the timezone of the location of the event (like the flight-time on an airport, this is always local time/local timezone. The difference between the time of departure and arrival is different from the flighttime, if the timezones of the two airports are different).

[2]: If you use the module Feeds (http://drupal.org/project/feeds) to import events, please patch Feeds until issue http://drupal.org/node/722740#comment-5373838 is patched to the module.

[3]: If you update the calendar-module it may be necessary to delete the old calendar-view and create a new calendar-view using this Cookbook.

 

Good luck!

Comments

woohoo! this is just what the

woohoo! this is just what the doctor ordered!

thanx a lot wusel!

Dries bless you!

I was about to go crazy with my own useless version of event calendar :P

Thanks, and i mean it.

nico

PIÑA&POLLO

problem

do not know if it's the place to talk about it.
but I have the following problem:
Calendar does not advance to the next month
When I click the next or previous month link

links like this
http://mysite.com/calendar-node-field-data/month/2012-06

do not move the calendar

any ideas?

My tipps

Visit 'http://example.com/admin/config/date/calendar' and do the Calendar Administration.
If you have updated the calendar-module it may be necessary to delete the old calendar-view and create a new calendar-view using this Cookbook

Wusel

Great, thanks for the cookbook

As a Drupal newbie I found your instructions clear, straightforward, and easy to follow.

Thanks very much :)

+++
Matthew Bourne
Independent Technical Consultant

This works great.

This was so helpful.
I really appreciate it.

Thx

Thanks U!

This is the one

Thanks wusel!
The key seemed to be using the Views Calendar template; when I tried to set up the contextual filter myself (not using the template) I always got errors on the date field, whether the event date field I created was type 'date' or 'date ISO'...saying 'group field required'. I don't know if it is b/c the template uses 'OR' not 'AND'
Again, thank you!

zorgalina

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Audience
Programmers, Site administrators
Keywords
Calendar, event

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.