FAPI vs CCK (or are they really good friends?)

Events happening in the community are now at Drupal community events on www.drupal.org.
patrickfrickel's picture

I have been going though posts to try get some direction on data collection via forms in D6.

The story so far:

I could use cck to create a content type and then collect data, but, working with this has been a bit frustrating. The form insists on title, menu, and other elements that I don't want or need.

OR I could investigate FAPI and learn to code in the form in this medium.

From what I understand, and I'm obviously requiring direction, is I could:

  1. Create a content type in CCK
  2. Use the FAPI to create a form to use the content type to collect data
  3. Use views to "Slice and Dice" the data.

Is this understanding correct or should I be looking elsewhere?

Comments

Although the forms generated

floretan's picture

Although the forms generated by CCK have some limitations, they provide a great starting point. I think steps 1 and 3 are right, but for step 2 you probably want to modify the CCK form with hook_form_alter() (and eventually use #after_build for advanced uses). The advantage is that you don't need to worry about dealing with saving the nodes yourself, you just need to specify the custom aspect of your form.

Your nodes do not have to

advseb's picture

Your nodes do not have to have a title and body field. To get rid of the body field, just leave the title of the body field empty. Nodes must always have a title, therefore you can't get rid of the title. However, you can use the "Automatic Nodetitles" module to generate the title automatically. In that case your users do not have to enter the title anymore.

Data collection on a website...

alanburke's picture

with forms you say...

How about
http://drupal.org/project/webform

soon with views integration [hopefully]
http://drupal.org/node/273837

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: