2

I need to develop a Drupal site on which, among other things, a user can compile a form containing a list of its contacts and appointments with many custom fields.

I don't know which is the better thing to do between

  • having a custom MySql table; and
  • having a CCK table using a custom content type

I know that CCK makes a part of the work for me but I find it a little heavy in creating and handling fields.

What is your opinion?

Cris
  • 12,124
  • 27
  • 92
  • 159

2 Answers2

5

The Drupal community goes with MPD's answer, mostly: CCK, with Views.

Personally, I hardly ever find that a good solution. The only place where IMO Views and CCK offer a real benefit in time and effort, is when the end-result is poorly or loosely defined. If, however, you have wireframes, mockups or designs to work to, views+cck will require a lot of undoing.

Another important consideration is Drupals lack of deployment. Too often, you create CCK+views, and throw a sauce of theming and some custom (form alter) code over it. The chance then has an ugly deployment: without the new configuration (e.g. that new CCK field you defined) your theme breaks. But without the new theme, your new CCK-field breaks. In Drupal that is often "solved" with some downtime, during witch new code is rolled out and immediately followed by manually reconfiguring these fields. Though there are some complex "solutions" to this in the form of strongarm or features.

All in all, you will end up with CCK, Views, a bucketload of CCK fields-modules, VIEW addons and lots of gluecode. In the theme side, you end up with large and Div-infected overrides.

While all this was possible in a simple, clean, maintainable and highly optimised custom module with a single optimised and clean module.

It all comes down to how at home you feel with code. I, personally, don't mind cranking out a few lines of (clean, well architectured) PHP; others prefer to steer away from coding and prefer clicking around (though, In my experience they end up coding against more complex interfaces in the end, anyway)

Community
  • 1
  • 1
berkes
  • 26,996
  • 27
  • 115
  • 206
  • I wouldn't necessarily disagree this, but I wouldn't say the "large and div-infected overrides" is true in all cases. You can get clean HTML by using not the Views UI to format fields and using good view templates. I would also argue that the non-code aspect can be a good thing. I can often get non-technical people to build basic content types and views, and then hand them off to me for fancy stuff. Otherwise, I voted this up because it does sum up the non-CCK option fairly well. – mpdonadio Jan 24 '11 at 20:22
  • Using good views templates defies the a large purpose of views: a change trough the web-interface *requires* a change in the template. You couple code to settings in a tight way. – berkes Jan 25 '11 at 13:52
3

Personally, I feel that using a custom content type w/ CCK fields is almost always the best option, mainly because CCK integrates so closely with other Drupal modules (especially Views).

mpdonadio
  • 2,891
  • 3
  • 35
  • 54