HandsOn CCK

To get started with our Job Posting website, let's think about the different content types needed to build all the functionality that we require. The site requires two different types:

Job Type

Description and details of a particular job opening.

Job Application Type

An application ties together an individual and a particular job.

We will need to relate job applications back to the appropriate job openings, as well as relate jobs back to the appropriate contact person. The node reference and user reference fields mentioned earlier in the chapter will be an essential tool.

Create Job

Job Title: Description:

Department: Admissions i"T"| Salary: $|2Q,OOQ ~ Contact: admin ~T)

f Save

Job Application

Title: Cover letter:

Job: ' Rodeo ciowr ij ESHS^^^H—Node reference: list ofjobs

Resume: /Documents/resume.pdf (Browse (Save)

[Rodeo Clowr

Fast legs a must, P-eferably good with studer's,

-User reference: list ofusers

[I want this job!

I have over 7 years experience...

Figure 3-5. A mock-up of the forms required for the job website

Enabled

Name

Version

Description

Allows administrators to define new content types.

Required by: Content Copy (disabled), Content Permissions (disabled), Date

Content

6.x-2.Q-beta

(disabled). Date Copy (disabled). FieJdgroup (disabled). FileField (enabled), Node Reference (enabled). Number (enabled), Option Widgets (enabled), Text (enabled), User Reference (enabled), FileField Meta (disabled)

B

Content Copy

6.x-2.0-beta

Enables ability to import/export field definitions, Depends on: Content (enabled)

Content Permissions

6.x-2.0-beta

Set field-level permissions for CCK fields. Depends on: Content (enabled)

B

Fleldgroup

6.x-2.Q-beta

Create field groups for CCK fields, Depends on: Content (enabled)

Defines a file field type.

0

FileField

6.x-1.Q-beta2

Depends on: Content (enabled) Required by: FileField Meta (disabled)

n

FileField Meta

6.x-1.0-beta2

Add metadata gathering and storage to FileField. Depends on: FileField (enabled), GetidS (missing). Content (enabled)

a

Node Reference

6.x-2.0-beta

Defines afield type for referencing one node from another, Depends on: Content (enabled), Text (enabled), Option Widgets (enabled)

a

Number

6.x-2.0-beta

Defines numeric field types, Depends on: Content (enabled)

Defines selection, check box and radio button widgets for text and

a

Option Widgets

Depends on: Content (enabled)

Required by: Node Reference (enabled), User Reference (enabled)

Defines simple text field types.

a

Text

6.x-2.0-beta

Depends on: Content (enabled)

Required by: Node Reference (enabled), User Reference (enabled)

a

User

6.x-2.0-beta

Defines a field type for referencing a user from a node.

Reference

Depends on: Content (enabled), Text (enabled), Option Widgets (enabled)

Figure 3-6. Enabling CCK modules

When building out content types in Drupal, it's best to start with a mental picture of what the form looks like that you're trying to build. Figure 3-5 shows a sketch of both the job and job application forms that we're shooting for.

1. To enable CCK, go to AdministersSite buildings-Modules (admin/build/modules). Enabling CCK involves two parts: enabling the Content module, which is the "core" of CCK, and enabling one or more "field" or "widget" modules.

The FileField module is a separate module that is not included as part of the default CCK installation. It may be downloaded from http://drupal.org/project/filefield, and is also included in the book's source code.

2. Enable the following modules and click "Save configuration." After the modules are enabled the page should look like Figure 3-6:

—FileField

—Node Reference —Number

— User Reference

Was this article helpful?

0 0

Post a comment