Welcome to my first tutorial. I hope you can follow along. This tutorial walks you through the basics of creating a CCK field type. This tutorial will target Drupal 5.x.
For those who don't know, CCK is Drupal's Content Construction Kit.
CCK allows you to create custom node types and extend existing node types with custom fields. These custom fields are the building block of complex content types and encapsulate handling for complex data types.
When used in conjunction with Views, Actions, and Workflow, CCK enables non-developers to build applications with a minimal amount of coding. Don't be lulled into a false sense of security, CCK can get you 80% of teh way, but it is not a panacea. You must understand your application and CCK in order to use it effectively. You will run into limitations with the stock field types and find yourself needing to modify their behavior, implement custom widgets, and add new formatters. This tutorial attempts to arm you for these occasions occasion.
In this tutorial we will develop a basic referral field. A referral field in this context would be some sort of link away from your website with an id, image, description, and url. Some examples of what I call referral's are affiliate sales and product offer links, like spam arrest or amazon product links.
I want to accomplish two basic goals with this field.
In this tutorial we will focus on the basic field apis and their interaction with content.module. In future tutorials we will extend our referral field to offer amazon widgets and provide click through tracking via custom formatters.
In Part One we examine CCK's Field hooks and begin implementing our ReferralField Module.