Tutorial on How to Use Drupal CCK
Drupal content is referred to as nodes. Drupal comes with basic nodes, including page, story, forum and poll. These nodes, however, do not contain extra fields of content, such as a way to reference other nodes, more text areas, image fields or a way to reference other users. The CCK module, or Content Construction Kit, allows you to create new node types that can contain several widgets and content areas.
Instructions
-
-
1
Plan your content type. Create a wish list of what the content type should do. For this tutorial, make a content type called "Article" where the the user can add the following fields: Headline, Summary, Image, Links and Related Content. CCK core comes with the ability to add text fields, but you have to add other CCK modules; the Link module and The ImageField module.
-
2
Download CCK, ImageField module and the Link module for CCK from the Drupal downloads page. You also need to download the FileField module for Image field to work.
-
-
3
Extract modules to your Drupal installation's file server to the "/sites/all/modules" folder. You can do this directly through an SSH client or by extracting the module to your computer, then uploading it to the "sites/all/modules" folder with an FTP client.
-
4
Go to "Administer > Site Building > Modules" in your Drupal administration interface and enable the CCK FileField, ImageField and Link modules. Modules that belong to the CCK group, such as Link and ImageField, will automatically appear in the CCK section of the Modules interface.
-
5
Navigate to "Administer > Content Management > Content types." Click "Add Content Type." Name both the content type and its title "Article." Give the title a description if needed. Save the content type. Once you save the content type, you will be taken back to the Content Management page. Look for your content type and click on the edit to add the other fields.
-
6
Add other content fields. On the edit page, click on the Manage Fields tab. To add an image field, fill out the fields under "Add > New field." Name the label for your field, in this case, "Image," then the "field_ variable," in this case, "Image." In the pull down field titled "Select Field Type," select "File," then select "Image" as opposed to "File upload" as the widget. Press "Save." You will now be taken to the image configuration page where you can further configure how users use this field, then click "Save." Repeat the above steps to add an area for links on your content using the Link CCK feature.
-
7
Click a link on the Navigation menu titled "Create Content" or navigate to the "Content Management" page to test your new node/content type. Select the "Article" content type and double check that the Image and Link fields are available. Add your content and save your new "Article" content type.
-
1
Tips & Warnings
To arrange the order that the several fields are displayed in your content type, select "Display Content" on the Edit page of the content type found in the Content Management interface where you first added your content type.
References
Resources
- Photo Credit Comstock/Comstock/Getty Images