LevelTen Interactive

cck

How to Remove the Field Name from a Drupal Content Type in 3 Simple Steps

Recently, a member of DrupalSN.com (a social community for Drupal users) posed a question, "Is there a way to remove the label for a field on a content type?". This question brings up an interesting feature of the CCK module in Drupal - the ability to style your content types on a field level. Here's how to do it:

Note: this tutorial assumes that you have the CCK module installed on your Drupal website, and you've already created a content type.

Step 1: Click on "Edit Content Type" in the Drupal Administration Menu

Drupal CCK Image Field Missing on Module Upgrade

Solution: 

A recent upgrade of the ImageField module changes the way you add an Image CCK field. In the first drop-down list, select "File", and select "Image" in the second drop-down list.

cck select list showing image field option

The node skeleton technique - combining the power of module and CCK based nodes

Nodes fall into 3 categories:
1. Generated via a module, no CCK fields
2. Generated by CCK only
3. Created via a module with CCK fields added

For L10 projects, the CCK should not be used to create new content types (node type 2 from above). In instances where you may be tempted to create a node wholly by the CCK, create a node skeleton module and enable it first, then use CCK to add fields. A node skeleton does not add its own table.

When using CCK, do we need to program in hook_load to load the data for the new fields

No, unless you need extra or custom data. The CCK automatically handles loading of data for the fields created via the CCK. In general the CCK does a good job loading its data, however there are times where you might want additional data that is not automatically loaded.

Drupal node module skeleton

Recipe for creating a node module skeleton:
1. Create three files using the code snippets at the bottom of this post

  • foo.info
  • foo.module
  • foo.theme

Note: replace foo with your module name. If this is for a specific project, use project codes in the format [pc][nodetype]

2. do the following search and replace on all three files
"[pc]foo" -> [pc][nodetype]
"foo" -> [nodetype]

foo.info code:

  1. ; $Id $
  2. name = "Foo"
  3. description = "Foo posts."
  4. package =
  5. dependencies =

foo.module code:

Syndicate content
Syndicate content

©1999 - 2010 LevelTen Interactive - Dallas, TX