When the fields are added via CCK, do we need to create columns manually

When the fields are added via CCK, do we need to create columns manually

No, one of the benefits of the CCK is that it manages the dabase tables for you including table creation and collumn management. When you add a new field via cck, it automatically generates one or more collumns, depending on the field type you selected. Those collumns will get added to a table called "content_type_[contentTypeMachineName]". If you have multiple content types and wish to add similarly named fields for each, there are two items to look out for. When creating a field of the same name on two different content types you have two options: 1. Add exiting field 2. Create a new field Adding an existing field enables sharing of field types between nodes. When multiple content types share a field type, the CCK stores the collumns in a seperate table named " content_field_[TypeMachineName]". When you create a field type for the first time, the collumns are added to the content_type_... table. When you add existing to a second content type, it removes the fields from the first content_type_ table and creates the content_field_... table. The second option is to "Create new field". If you give your fieldMachineName the same name as an existing field the CCK will add the collumns to the second table but and an index to the name. So if the collumns added to the first content type are "widget" and the same field name is added to a second content type via the Create new field, the CCK will add a collumn named "widget_1" to the second content_type_... table.

Additional Resources

http://www.lullabot.com/articles/an_introduction_to_the_content_construc...

Related Posts

Converting Views List Into Responsive Stacked Columns

Mark Carver
Read more

Adding fields in Drupal 7

Tom McCracken
Read more

Using Image Fields in Drupal 7

Tom McCracken
Read more

Introduction to fields in Drupal 7

Tom McCracken
Read more

Drupal Tutorial: List Fields

Tom McCracken
Read more

Understanding Drupal 7 core fields structure

Tom McCracken
Read more