Template files for CCK fields
Theming Constructed Content Types
After you have designed your content, you will likely want to lay out the presentation of the content. This is most easily done with PHPtemplate-based themes. There are two basic options for theming your content, depending on the level of control you need to exert.
Theming individual fields
This method is straightforward and allows for sensible defaults, but requires a modest amount of setup. Place the "field.tpl.php" and "template.php" files found in the theme folder of the CCK download in your theme's folder. If you already have a "template.php" file, you will need to append the code in this one to your own.
All fields are now rendered using your "field.tpl.php" template. If you want to change them all the same way (for example, to hide every field label), you can make alterations to this file. If you want to change the presentation of one field independently, you should instead make a copy of this file first, and give it the name "field-field_foo.tpl.php" where "field_foo" is the field name as listed on the administration page. Changes you make to this file will be reflected only in that field.
An $items variable is made available to you in your field template. This contains the content of the field you are rendering. It is always an array, so that the syntax is consistent whether or not the field allows for multiple values. Each item has a "view" property that contains the filtered, formatted contents of the item. You should always use this property in your display for security reasons, unless you are very familiar with how to properly process output and avoid scripting exploits.
The included example here ("field-field_my_field.tpl.php") illustrates a minimalistic approach to field theming, for a single-valued field. For a more flexible template, start from the "field.tpl.php" included in the theme folder of the CCK download.
Available variables in field templates :
$items : an array containg the values of the field.
$items[n]['view'] contains the ready-to-use, filtered, formatted value
$label : the label of the field
$label_display : the display settings for the label ('hidden', 'above', or 'inline')
$field_empty : TRUE if there is nothing to display in the field
$field_type : the type of the field,
$field_name : the name of the field,
$field_type_css : same as above, with '-' signs replaced with '_' for use in css properties
$field_name_css : same as above, with '-' signs replaced with '_' for use in css properties
$field : an array containing the full CCK field object
Update for CCK 2
- Copy the "content-field.tpl.php" file from the CCK/themes folder into your theme's directory. You do not need to edit template.php.
- To create a template for a specific field, the template filename should be "content-field-field_name.tpl.php" (i.e. "content-field-field_foo.tpl.php" for a field named "field_foo"). Please note that you MUST also include the base 'content-field.tpl.php' file in your theme directory in order for any custom CCK field templates to be detected (see #279573: Themes can't use node-story.tpl.php without node.tpl.php for more info).
- Clear the theme registry in order to have the new templates detected.
See #269319: How to theme CCK field by declaring a field-my_field.tpl.php file for more details.
Theming Field Groups (Display Element "fieldset")
To theme field groups, which are rendered by default as a fieldset HTML element, you may use a file called fieldset.tpl.php if you modify your template.php. See http://drupal.org/node/36900#comment-150561.
This is handy if you want to change the presentation of the fields in the group from its default (a series of div elements) into, for example, a table. You can create a fieldset.tpl.php that defined the table container and the file field.tpl.php can define the elements of the table.

is this current for drupal 6
And also, the page that the link directs through to has many more links to choose from. Can we have a specific link indicating where to get this extra information and any changes for D6?
thanks,
Renaee.