290 likes | 512 Views
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.
E N D
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. • 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. From CCK Handbook and “CCK Module Basics”
Why do we need CCK? • New fields can improve organization of information. • Makes information easier to find. • Makes the information easier to search and extract. From CCK Handbook and “CCK Module Basics”
Why do we need CCK? • Adds a lot more flexibility to Drupal. • 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. From CCK Handbook and “CCK Module Basics”
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) 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) • Text • Decimal • Float • Integer • Node Reference • User Reference From “What is the Content Construction Kit? A View from the Database.” and “CCK ModuleBasics”
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
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 CCKsites/all/modules/
Adding fields to content types with CCK: http://people.oregonstate.edu/~monka/Webpage/drupal-6.17/
DB after activating CCK and all of its sub-modules cache_content 1 content_group 0 content_group_fields 0 content_node_field 0 content_node_field_instance 0 5
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