The Assignment Content Type

To create Assignments, we will create another content type. This content type will be very similar to the blog post content type we just created, with one exception: Assignments will contain a Date field to allow teachers to specify a Due date. As described earlier in this chapter, and in Chapter 3, we need to follow four steps:

1. Create the content type

2. Add fields to the content type (optional—not all content types require additional fields)

3. Assign a taxonomy to the content type (optional—not all content types will be organized using taxonomy)

4. Assign permissions to the content type

Getting Started: Installing Modules

To add and display date fields, we need to download and install the Date and Calendar modules. Navigate to the project pages for Date and Calendar at

http://drupal.org/project/date and http://drupal.org/project/calendar.

As described in Chapter 3, upload the modules into the sites/all/modules directory.

Then, click the Administer | Site building | Modules link, or navigate to admin/build/modules as shown in the following screenshot:

w Date/Time

Enabled Name

Description

Views plugin to display vie ye captaining dates as Calendars. Calendar 5.x-2.x-dev Depends an: Views (enabled). Date API (enabled). Date Timezone (enabled) Required by: Calendar iCal (disabled). Calendar Popup (enabled)

Adds ical functionality to Calendar views. 6.x-2.x-dev Depends on: Views (enabled). Date API (enabled). Calendar (enabled). Date Timezone (enabled)

Replaces the links to calendar items with a javascript popup that gracefully _ _ . regresses if javascript is not enabled

Depends on: Calendar (enabled). Views (enabled). Date API (enabled), Date Timezone (enabled)

Defines CCK date/time fields and widgets. 6.x-2.x-dev Depends on: Content (enabled). Date API (enabled). Date Timezone [enabled) Required by: Date Copy (disabled)

Calendar iCal

Calendar Popup

Date API 5.x-2.x-dev

A Date API that can be used by other modules-

Required by: Calendar (enabled), Calendar ¡Cal (disabled). Date (enabled). Date PHP4 (disabled), Date Popup (enabled). Date Repeat API (disabled). Date Timezone (enabled). Date Copy (disabled). Calendar Popup (enabled)

Date Copy

Import and export CCK date data.

Depends on: Content (enabled). Date (enabled}. Date API (enabled). Date Tim (enabled)

Date PHP4

Emulate PHP 5.2 date functions in PHP 4.x, PHP 5.0, and PHP 5.1. Required when using the Date API with PHP versions less than PHP 5.2. Depends on: Date API (enabled)

Date Popup

Enables jquery popup calendars and time entry widgets for selecting dates and times.

Depends on: Date API (enabled), Date Timezone (enabled)

Date

Repeat

A Date Repeat API to calculate repeating dates and times from iCal rule Depends on: Date API (enabled)

Needed when using Date API. Overrides site and user timezone handling to set timezone names instead of offsets. Depends on: Date API (enabled)

Required by: Calendar (enabled). Date (enabled). Date Popup (enabled). Calendar iCal (disabled), Date Copy (disabled), Calendar Popup (enabled)

Date

Timezone

Enable the Calendar, Calendar Popup, Date, Date API, Date Popup, and Date Timezone modules. These modules are all part of the Date and Calendar modules.

Click the Save configuration button to save the settings, and enable the modules.

Navigate to Administer | Content management | Content Types, or admin/ content/types. Click the Add content type tab.

For the Identification section, use the following values:

Name: Assignment

Type: assignment

Description: Add an assignment.

In the Submission form settings section, the Explanation or submission guidelines can be set to: Create an assignment. Remember to set a due date. Additionally, you can change the Body field label to Description.

In the Workflow settings, set default settings to Published.

In the Comment settings section, set the default to Read/Write, and configure the comment displays as described in Chapter 3.

Click the Save content type button to create the content type.

If your server has a PHP version below 5.2, you will need to enable the Date PHP4 module. To check your PHP version, click the Administer | Reports | Status report link, or navigate to admin/reports/status.

Was this article helpful?

0 0

Post a comment