Drupal: CCK

Preview:

DESCRIPTION

Drupal: CCK. By J.J. Admire, Andrew Monk, and Tyler Jones. Overview. Learn what CCK is and why we need it. Learn a little about how to use CCK. Learn a little on how CCK works. What is CCK?. CCK stands for the Content Construction Kit. - PowerPoint PPT Presentation

Citation preview

Drupal: CCK

By J.J. Admire, Andrew Monk, and Tyler Jones.

Overview

• Learn what CCK is and why we need it.• Learn a little about how to use CCK.• Learn a little on how CCK works.

What is CCK?

• CCK stands for the Content Construction Kit.• A module installed into Drupal (not a part of

the Drupal 6 Core).• Allows creation and organization of new fields

into content types.

From Content Creation Kit Handbook

Why do we need CCK?

• New fields in a content type can improve workflow.

From CCK Handbook and“CCK Module Basics”

Add fields to make sure people don’t forget to post information Require the data in the field to be a specific type. Require that a field be filled out. Relocate where the field shows up in the form. Group fields together.

Page before fields added.

Page after fields added.

Why do we need CCK?

• New fields can improve organization of information.

From CCK Handbook and“CCK Module Basics”

Makes information easier to find. Makes the information easier to search and extract.

Why do we need CCK?

• Adds a lot more flexibility to Drupal.

From CCK Handbook and“CCK Module Basics”

Lets you make specific forms for the information you want. Lets you add or delete specific fields easily. Gives you more flexibility with other modules.

Page after fields deleted.

What does CCK come with?

• Allows the admin create and organize new field types through the browser interface.

• Lets the admin set the type of data to be stored by the field, and the widget to be used to collect the data.

• Allows the admin to set how and when a field is displayed.

• Lets the admin set field level permissions.• Lets the admin import/export fields.• Allows PHP code to get default values and/or allowed

values for fields.From CCK Handbook and“CCK Module Basics”

Types that come with CCK core.

Field Types (Data to be stored)

• Text• Decimal• Float• Integer• Node Reference• User Reference

Widget Types (Used to collect info from user)

• Text field• Select list• Checkboxes/Radio buttons• Single on/off checkbox• Text Area (for text input)• Autocomplete text field (for

Node or User Reference input)

From “What is the Content Construction Kit? A View from the Database.” and “CCK ModuleBasics”

Page with a select list.

Sources:

• Douglas, Robert. “What is the Content Construction Kit? A View from the Database.” Lullabot.com

• learnbythedrop. “CCK Module Basics.” learnbythedrop.com

• Content Construction Kit Handbook. drupal.org

Installing Content Creation Kit

● Download at● http://drupal.org/project/cck● Extract the CCK file to:● drupal-6.17/sites/all/modules

Activating CCKAdministrator → Modules

CCK is a group of modules. The “Core CCK” modules are:

Adding Additional Fields For CCK

● The power of CCK is in the types of fields it allows you to add to content types.

● Many of the fields you would want to add to your content type must be downloaded and enabled separately.

● Download addition fields at:● http://drupal.org/project/modules

Add additional fields to same folder as CCK

sites/all/modules/

Adding fields to content types with CCK:

http://people.oregonstate.edu/~monka/Webpage/drupal-6.17/

• Initial DB before the CCK is activated

• DB after activating CCK and all of its sub-modules

cache_content 1content_group 0content_group_fields 0content_node_field 0content_node_field_instance05

• Adding a field to a single already created type

• cache_content 1• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 1• content_type_page 0• 6

• Adding the new field to another already created type

• cache_content 1• content_field_test_next 0• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 2• content_type_page 0• content_type_story 0• 8

• cache_content 1• content_field_test_next 0• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 2• content_type_page 0• content_type_story 0• 8

• Adding a new content type with no custom fields

• Adding the custom field to the custom type

• cache_content 2• content_field_test_next 0• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 3• content_type_page 0• content_type_story 0• content_type_test_type 0• 9

• Creating a page using the content type

• cache_content 4• content_field_test_next 1• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 3• content_type_page 0• content_type_story 0• content_type_test_type 1• 9

• Updating a pre-existing story page

• cache_content 3• content_field_test_next 2• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 3• content_type_page 0• content_type_story 1• content_type_test_type 1• 9

• Update the rest of the pre-existing pages

• cache_content 3• content_field_test_next 5• content_group 0• content_group_fields 0• content_node_field 1• content_node_field_instance 3• content_type_page 3• content_type_story 1• content_type_test_type 1• 9

Questions?