Lab 9: Event Management and Calendar

20 points

Suppose you were preparing a website to keep track of a dorm calendar of events. Members might want to be able to see when events are happening on a calendar and post their own events to the site. To make it easy to see what is coming next, there should be a short block of upcoming events that could be placed on a homepage. The calendar should offer daily, weekly, and monthly views as well as a way to subscribe to the calendar using Microsoft Outlook or Apple iCal. Finally, it would be good if there were a way to track those who are planning to attend.

In Lab 9 you will set up this event management system on your lab server.

Tasks

  1. For this lab you will need to install the modules Date, which provides a date field for content types, Calendar, which can display events in a calendar format, and Date iCal, which can set up an iCal feed. You'll also need Libraries. Make sure the following modules are enabled: Libraries, Date API, Date, Date All Day, Date Popup, Date Views.
  2. Event content type

  3. Create new new content type called Event, with description Dorm event, and fill in appropriate values:
  4. Set up access control appropriately. Give authenticated users and higher the ability to add events.
  5. Create three example events on different days, two upcoming (one at least a month in the future) and one more than a day in the past.
  6. Event view

  7. Add a new node view named "Upcoming Events" with the description "A block of upcoming events". It should show content of type event. Set it to create a block, not a page, with display format HTML List of titles (linked). Click Continue & Edit.
  8. In the Fields section, add Content: Time, but don't display the label "Time:" Display the time in the Medium format.
  9. Now we want to configure the view to show upcoming events: Add a filter on the Content Time - start date field and Click apply twice. Set the operator to "is greater than or equal to", set the date selector to "Enter a relative date," and type in "now". You should see only future events in the preview.
  10. In the Sort critera box, add a sort on Content: Time (ascending).
  11. Save this block and add it to a sidebar on the site's home page.
  12. Calendar view

    The calendar view module provides a rich new View type called Calendar, but it requires various arguments to be set up properly. For example, if the calender URL is calendar, the Calendar view will handle URLs like calendar, /calendar/month, etc.

  13. Enable the modules Calendar and Date iCal.
  14. On the Views administration page, click "Add view from template". Click "add" beside "A calendar view of the 'field_time' field in the 'node' base table." Click continue.
  15. On the View configuration page, make sure the Month display is selected, and change the title to "Calendar of Events." Under Page Settings, change the Path: to /calendar/month". Save your settings.
  16. Test the URLs /calendar/month and /calendar/year.
  17. Use Structure -> Menus to add a menu item to the main menu labeled Calendar that opens the monthly calendar view.

    Taking it further (optional)

    Do you want to track who will attend events? Let's add an "I will attend this event" link at the bottom of each event, together with an "Attendees" view for each event.

  18. Install the Flag, module, which allows you to add on/off switches to items. Enable it.
  19. Go to Structure -> Flags and edit the existing bookmark. Change its name to attendance and its link text to "attend this event." Change its unlink text to "cancel attendance". Fill out other options appropriately.
  20. Create a view that will list the attendees for any event. You'll need to add a relationship to "Flags: User's flagged content" to get access to the flag information. You'll also need to add an argument, Flags: Content ID.

Turn In

I will check your website directly from the link on the course page.